RUNJCL TO KSDS CLUSTER(WRITE)


***** RUNJCL TO KSDS CLUSTER(WRITE) ***** 

 IDENTIFICATION DIVISION.                        
 PROGRAM-ID. MEM3.                               
 ENVIRONMENT DIVISION.                           
 INPUT-OUTPUT SECTION.                           
 FILE-CONTROL.                                   
         SELECT OUT-FILE ASSIGN TO DD1               
         ORGANIZATION IS INDEXED                     
         RECORD KEY IS ENO                           
         FILE STATUS IS FS1.                         
 DATA DIVISION.                                  
 FILE SECTION.                                   
 FD OUT-FILE.                                     
 01 OUT-REC.                                     
   02 ENO PIC 9(4).                              
   02 ENAME PIC X(4).                            
   02 SAL PIC 9(5).                              
   02 FILLER PIC X(67). 
WORKING-STORAGE SECTION.                   
 01 IN-FILE.                                
   02 OUTDATA OCCURS 3 TIMES.               
     03 ENO1 PIC 9(4).                      
     03 ENAME1 PIC X(4).                    
     03 SAL1 PIC 9(5).                      
 77 FS1 PIC 9(2).                           
 77 I PIC 9.                                
 PROCEDURE DIVISION.                        
           PERFORM OPEN-PARA.                     
           PERFORM ACCEPT-PARA 3 TIMES.           
           PERFORM CLOSE-PARA.                    
 OPEN-PARA.                                 
          OPEN OUTPUT OUT-FILE.                  
          ACCEPT-PARA.                               
          MOVE 1 TO I.                           
          ACCEPT ENO1(I).                        
          ACCEPT ENAME1(I).                      
          ACCEPT SAL1(I).                
          WRITE OUT-REC FROM IN-FILE.    
          COMPUTE I = I + 1.             
  CLOSE-PARA.                        
            CLOSE OUT-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