khaleesee
khaleesee

Reputation: 1

point statement in easytrieve

What is the point statement in easytrieve?

eg- POINT DUPIN GE HD-IN-KEY STATUS

Here DUPIN is filename , GE is relational operator, HD-IN-KEY is field name

Upvotes: 0

Views: 2539

Answers (1)

Srinivasan JV
Srinivasan JV

Reputation: 705

Not sure if I can revive old questions. I just thought of leaving an example with usage of POINT statement in Easytrieve. It might be useful to someone referring this thread.

In this example, I'm using an Input VSAM file with following contents.

123456 SRINIVASAN J V
234567 QWERTY        
345678 SRINI         
456789 BHUTAN    

First 6 bytes is the key and I would like to display the text field against the key. Let's choose to display the text field of 123456, the first record. The Easytrieve code is as follows:

FILE INFILE1 VS (UPDATE)             
ID                1   6    N         
NAME              8   20   A         
* WORK VARIABLES                     
WS-ID             W   6    N         
WS-NAME           W   20   A         
*                                    
JOB INPUT INFILE1                    
POINT INFILE1 EQ '123456' STATUS     
IF INFILE1:FILE-STATUS EQ 00         
    DISPLAY 'READ SUCCESS'            
    MOVE NAME TO WS-NAME              
    DISPLAY 'TEXT:' WS-NAME           
    STOP                              
ELSE                                 
    DISPLAY 'READ ERROR:' FILE-STATUS 
    STOP                              
END-IF    

After executing the code, we will have the following results in the Spool.

READ SUCCESS       
TEXT:SRINIVASAN J V     

Points to be noted:

  • The POINT statement in Easytrieve points a record on a keyed file.

  • Note the POINT statement with STATUS parameter. Specify the STATUS parameter whenever there is a possibility for unsuccessful completion of the input/output request. STATUS checks input/output processing to see if it was performed properly. STATUS causes the file's FILE-STATUS field to be set with the appropriate return code. FILE-STATUS is a read only field in Easytrieve.

  • We evaluate the FILE-STATUS field to know the status of READ operation. If the READ is success, then we display the text field.

Upvotes: 1

Related Questions