REWRITE A RECORD IN RRDS CLUSTER


***** REWRITE A RECORD IN RRDS CLUSTER *****

 IDENTIFICATION DIVISION.               
 PROGRAM-ID. DELR.                      
 ENVIRONMENT DIVISION.                  
 INPUT-OUTPUT SECTION.                  
 FILE-CONTROL.                           
         SELECT IN-FILE ASSIGN TO DD1     
         ORGANIZATION IS RELATIVE         
         RELATIVE KEY IS REL-KEY          
         ACCESS MODE IS RANDOM            
         FILE STATUS IS FS1.              
 DATA DIVISION.                          
 FILE SECTION.                          
 FD IN-FILE.                            
 01 IN-REC.                             
    05 ENO PIC 9(4).                    
    05 ENAME PIC X(4).                  
    05 SAL PIC 9(5).  
    05 FILLER PIC X(67).                                  
 WORKING-STORAGE SECTION.                                 
 01 REL-KEY PIC 9.                                        
 01 OUTREC.                                               
   02 ENO1 PIC 9(4).                                      
   02 ENAME1 PIC X(4).                                    
   02 SAL1 PIC 9(5).                                      
01 FS1  PIC 9(2).                                        
PROCEDURE DIVISION.                                       
          OPEN I-O IN-FILE.                                  
          DISPLAY "FS1: " FS1.                               
         MOVE 9 TO REL-KEY.                                 
         MOVE 0005 TO ENO1.                                  
         MOVE "HHHH" TO ENAME1.                             
         MOVE 70000 TO SAL1.                                
         MOVE OUTREC TO IN-REC.                             
         DISPLAY "FS1: " FS1.                                
         REWRITE IN-REC INVALID KEY DISPLAY "NOT DONE".
         CLOSE IN-FILE.   

0 comments:

Computers TopOfBlogs Technology Blogs Mainframe interview question and answers,mainframe jobs,cobol,vsam,jcl,cics,db2,rdbms,mvs,tso,ispf,ibm,hcl,tcs,cts,wibro Blog Directory