JCL Tutorial

                                        About Us          Services          Courses          Case Studies          Mainframe Forum          Mainframe Jobs          Contact Us            Mainframe Connectivity


 
Basic COBOL program ...

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. DISPGM.                                            
 ENVIRONMENT DIVISION.                                          
 DATA DIVISION.                                                 
 WORKING-STORAGE SECTION.                                       
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
        DISPLAY 'WELCOME TO INDUS COMPUTER SERVICES'.           
        STOP RUN.                                               

 

Execution JCL for a simple COBOL program


//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP1    EXEC PGM=DISPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//                                                              

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. ADDPGM.                                            
 ENVIRONMENT DIVISION.                                          
 DATA DIVISION.                                                 
 WORKING-STORAGE SECTION.                                       
 77 NUM1        PIC 9(3) VALUE ZEROS.                           
 77 NUM2        PIC 9(3) VALUE ZEROS.                           
 77 RESU        PIC 9(4) VALUE ZEROS.                           
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
        DISPLAY 'ENTER THE NUMBER ONE VALUE'.                   
        ACCEPT NUM1.                                            
        DISPLAY 'ENTER THE NUMBER TWO VALUE'.                   
        ACCEPT NUM2.                                            
        COMPUTE RESU = NUM1 + NUM2.                             
        DISPLAY 'THE RESULT OF TWO NUMBERS:' RESU.              
        STOP RUN.                                               

 

Execution JCL for a COBOL program which is having ACCEPT statements.

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP1    EXEC PGM=ADDPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
030                                                             
/*                                                              
//    
                                                         


 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. MULPGM.                                            
 ENVIRONMENT DIVISION.                                          
 DATA DIVISION.                                                 
 WORKING-STORAGE SECTION.                                       
 77 NUM1        PIC 9(3) VALUE ZEROS.                           
 77 NUM2        PIC 9(3) VALUE ZEROS.                           
 77 NUM3        PIC 9(3) VALUE ZEROS.                           
 77 RESU        PIC 9(4) VALUE ZEROS.                           
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
        DISPLAY 'ENTER THE NUMBER ONE VALUE'.                   
        ACCEPT NUM1.                                            
        DISPLAY 'ENTER THE NUMBER TWO VALUE'.                   
        ACCEPT NUM2.                                            
        DISPLAY 'ENTER THE NUMBER THREE VALUE'.                 
        ACCEPT NUM3.                                            
        COMPUTE RESU = NUM1 * NUM2 * NUM3.                      
        DISPLAY 'THE MULTIPLICATION OF 3 NOS:' RESU.            
        STOP RUN.                                               

Execution JCL

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP1    EXEC PGM=MULPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
020                                                             
020                                                             
/*                                                              
//                                                              

 

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. ADDPGM2.                                           
 ENVIRONMENT DIVISION.                                          
 DATA DIVISION.                                                 
 WORKING-STORAGE SECTION.                                       
 77 NUM1        PIC 9(3) VALUE ZEROS.                           
 77 NUM2        PIC 9(3) VALUE ZEROS.                           
 77 RESU        PIC 9(4) VALUE ZEROS.                           
 77 OPTION      PIC X(3) VALUE 'YES'.                           
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
        PERFORM ACC-ADD-PARA UNTIL OPTION = 'NO'.               
        STOP RUN.                                               
 ACC-ADD-PARA.                                                  
        DISPLAY 'ENTER THE NUMBER ONE VALUE'.                   
        ACCEPT NUM1.                                            
        DISPLAY 'ENTER THE NUMBER TWO VALUE'.                   
        ACCEPT NUM2.                                            
        COMPUTE RESU = NUM1 + NUM2.                             
        DISPLAY 'THE RESULT OF TWO NUMBERS:' RESU.              
        DISPLAY 'DO YOU WANT TO ADD MORE NUMBERS YES/NO'.       
        ACCEPT OPTION.                                          

Execution JCL

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP1    EXEC PGM=ADDPGM2                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
030                                                             
YES                                                             
040                                                             
025                                                             
NO                                                              
/*                                                              
//                                                              


JOB with multiple job steps..


//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP10   EXEC PGM=ADDPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
030                                                             
/*                                                              
//STEP20   EXEC PGM=ADDPGM2                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
030                                                             
YES                                                             
040                                                             
025                                                             
NO                                                              
/*                                                              
//STEP30   EXEC PGM=MULPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
020                                                             
020                                                             
020                                                             
/*                                                              
//                                                              

 

Passing data to the COBOL program using PARM parameter in JCL:

IDENTIFICATION DIVISION.                  
PROGRAM-ID. PARMPGM.                      
ENVIRONMENT DIVISION.                     
DATA DIVISION.                            
WORKING-STORAGE SECTION.                  
77 WS-LEN     PIC 9(4).                   
LINKAGE SECTION.                          
01 PARM-FILEDS.                           
   05 PARM-LEN     PIC S9(4) COMP.        
   05 PARM-TEXT    PIC X(13).             
PROCEDURE DIVISION USING PARM-FILEDS.     
MAIN-PARA.                                
       DISPLAY 'PARM-TEXT:' PARM-TEXT.    
       DISPLAY 'PARM-LEN:' PARM-LEN.      
       STOP RUN.                          


Execution JCL:

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEP1    EXEC PGM=PARMPGM,PARM=('VIJAY','BHASKAR')            
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//                                                              


Program to create a sequential file

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. WRIPGM.                                            
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO DD1                             
      ORGANIZATION IS SEQUENTIAL                                
      ACCESS MODE IS SEQUENTIAL.                                
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE                                                    
      RECORDING MODE IS F                                       
      LABEL RECORDS ARE STANDARD                                
      RECORD CONTAINS 44 CHARACTERS                             
      BLOCK CONTAINS 10 RECORDS.                                
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77  OPTION PIC X(3) VALUE 'YES'.                               
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                    
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN OUTPUT STU-FILE.                                      
 WRITE-PARA.                                                    
     ACCEPT STU-NO.                                             
     ACCEPT STU-NAME.                                           
     ACCEPT STU-ADDR.                                           
     WRITE STU-REC.                                             
     ACCEPT OPTION.                                             
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            


Execution JCL for a Physical Sequential (PS) file creation:

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=WRIPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.MASTER.STUFILE,                  
//         DISP=(NEW,CATLG,DELETE),                             
//         SPACE=(TRK,(1,1),RLSE),                              
//         UNIT=SYSDA,                                          
//         VOL=SER=OZAV07,                                      
//         DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)         
//SYSIN    DD *                                                 
1111                                                            
VIJAY                                                           
TANUKU                                                          
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//  
                                                           


Program to read a sequential file

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. REAPGM.                                            
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO DD1                             
      ORGANIZATION IS SEQUENTIAL                                
      ACCESS MODE IS SEQUENTIAL.                                
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE                                                    
      RECORDING MODE IS F                                       
      LABEL RECORDS ARE STANDARD                                
      RECORD CONTAINS 44 CHARACTERS                             
      BLOCK CONTAINS 10 RECORDS.                                
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77  OPTION PIC X(3) VALUE 'YES'.                               
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM REA-PARA UNTIL OPTION = 'NO'.                      
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN INPUT STU-FILE.                                       
 REA-PARA.                                                      
     READ STU-FILE                                              
          AT END                                                
             MOVE 'NO' TO OPTION                                
          NOT AT END                                            
             PERFORM DISPLAY-PARA                               
     END-READ.                                                  
 DISPLAY-PARA.                                                  
     DISPLAY 'STUDENT NUMBER:' STU-NO.                          
     DISPLAY 'STUDENT NAME:' STU-NAME.                          
     DISPLAY 'STUDENT ADDRESS:' STU-ADDR.                       
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            


Execution JCL for a PS file read program.

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=REAPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSABEND DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.MASTER.STUFILE,DISP=SHR          
//                                                              

 

Program to copy sequential file into other sequential file


 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. REWRPGM.                                           
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  

      SELECT STU-FILE ASSIGN TO DD1                             
      ORGANIZATION IS SEQUENTIAL                                
      ACCESS MODE IS SEQUENTIAL.   
                            
      SELECT STU-FILE-OUT ASSIGN TO DD2                         
      ORGANIZATION IS SEQUENTIAL                                
      ACCESS MODE IS SEQUENTIAL.                                
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE                                                    
      RECORDING MODE IS F                                       
      LABEL RECORDS ARE STANDARD                                
      RECORD CONTAINS 44 CHARACTERS                             
      BLOCK CONTAINS 10 RECORDS.                                
 01 STU-REC.                                                    
      05 STU-NO    PIC 9999.                                    
      05 STU-NAME  PIC X(20).                                   
      05 STU-ADDR  PIC X(20).                                   
 FD STU-FILE-OUT                                                
      RECORDING MODE IS F                                       
      LABEL RECORDS ARE STANDARD                                
      RECORD CONTAINS 44 CHARACTERS                             
      BLOCK CONTAINS 10 RECORDS.                                
 01 STU-REC-OUT.                                                
      05 STU-NO-OUT    PIC 9999.                                
      05 STU-NAME-OUT  PIC X(20).                               
      05 STU-ADDR-OUT  PIC X(20).                               
 WORKING-STORAGE SECTION.                                       
 77  OPTION PIC X(3) VALUE 'YES'.                               
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM REA-PARA UNTIL OPTION = 'NO'.                      
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN INPUT STU-FILE.                                       
     OPEN OUTPUT STU-FILE-OUT.                                  
 REA-PARA.                                                      
     READ STU-FILE                                              
          AT END                                                
             MOVE 'NO' TO OPTION                                
          NOT AT END                                            
             PERFORM DISPLAY-PARA                               
     END-READ.                                                  
 DISPLAY-PARA.                                                  
     MOVE STU-NO TO STU-NO-OUT.                                 
     MOVE STU-NAME TO STU-NAME-OUT.                             
     MOVE STU-ADDR TO STU-ADDR-OUT.                             
     WRITE STU-REC-OUT.                                         
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            
     CLOSE STU-FILE-OUT.                                        

Execution JCL for a program which is reading a PS file and writing into another PS file.

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID,REGION=6M                             
//STEP1    EXEC PGM=REWRPGM                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.MASTER.STUFILE,DISP=SHR          
//DD2      DD DSN=IND220.INDUS.MASTER.STUFILE.OUT2,             
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            VOL=SER=OZAV07,                                   
//            DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)      
//                                                              

 

Program to Create the variable length file:

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. VARFILE.                                           
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
         SELECT EMP-FILE ASSIGN TO EMPDD                        
         ORGANIZATION IS SEQUENTIAL                             
         ACCESS MODE IS SEQUENTIAL.                             
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD EMP-FILE                                                    
     LABEL RECORDS ARE STANDARD                                 
     RECORDING MODE IS V                                        
     RECORD CONTAINS 37 TO 55 CHARACTERS                        
     BLOCK CONTAINS 0 RECORDS.                                  
 01 EMP-REC.                                                    
     05 EMP-NO           PIC 9(4).                              
     05 EMP-NAME         PIC X(10).                             
     05 EMP-ADDR         PIC X(10).                             
     05 BONUS OCCURS 1 TO 3 TIMES DEPENDING ON TIM.             
         10 BONUS-TYPE        PIC X(5).                         
         10 BONUS-AMOUNT      PIC 9(4).                         
     05 EMP-SALARY       PIC 9(4).                              
 WORKING-STORAGE SECTION.                                       
 77 TIM          PIC 9(2) VALUE ZEROS.                          
 77 I            PIC 9(2) VALUE ZEROS.                          
 77 OPTION       PIC X(3) VALUE 'YES'.                          
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
         PERFORM OPEN-PARA.                                     
         PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                
         PERFORM CLOSE-PARA.                                    
         STOP RUN.                                              
 OPEN-PARA.                                                     
         OPEN OUTPUT EMP-FILE.                                  
 WRITE-PARA.                                                    
         DISPLAY 'ENTER THE EMPLOYEE NUMBER'.                   
         ACCEPT EMP-NO.                                         
         DISPLAY 'ENTER THE EMPLOYEE NAME'.                     
         ACCEPT EMP-NAME.                                       
         DISPLAY 'ENTER THE EMPLOYEE ADDRESS'.                  
         ACCEPT EMP-ADDR.                                       
         DISPLAY 'ENTER THE VALUE FOR TIM'.                     
         ACCEPT TIM.                                            
         PERFORM VARYING I FROM 1 BY 1 UNTIL I > 3  OR I > TIM  
             DISPLAY 'ENTER THE BONUS TYPE'                     
             ACCEPT BONUS-TYPE(I)                               
             DISPLAY 'ENTER THE BONUS AMOUNT'                   
             ACCEPT BONUS-AMOUNT(I)                             
         END-PERFORM.                                           
         DISPLAY 'ENTER THE EMPLOYEE SALARY'.                   
         ACCEPT EMP-SALARY.                                     
         WRITE EMP-REC.                                         
         DISPLAY ' DO YOU WANTS TO ENTER MORE RECORDS YES/NO'.  
         ACCEPT OPTION.                                         
 CLOSE-PARA.                                                    
         CLOSE EMP-FILE.                                        

Execution JCL for a variable length records file.
Note: Record length should be 4 bytes + max record length..

//IND220EX JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID                                   
//STEP1    EXEC PGM=VARFILE                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//EMPDD    DD DSN=IND220.INDUS.EMPFILE.TST2,                    
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=V,LRECL=59,BLKSIZE=0)         
//* Add 4 bytes to the maximum record length to get the LRECL field..     
//SYSIN    DD *                                                 
1111                                                            
VIJAY                                                           
TANUKU                                                          
02                                                              
FIRST                                                           
1000                                                            
SECOND                                                          
2000                                                            
25000                                                           
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
03                                                              
FIRST                                                           
2000                                                            
SECOND                                                          
3000                                                            
THIRD                                                           
4000                                                            
35000                                                           
YES                                                             
3333                                                            
ANUKURI                                                         
TANUKU                                                          
01                                                              
FIRST                                                           
500                                                             
23000                                                           
NO                                                              
/*                                                              
//                                                              

 

UTILITY PROGARM: IEFBR14


JCL to allocate the new Physical Sequential data set

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************************
//* JCL JOB EXECUTING THE IEFBR14 UTILTITY TO ALLOCATE PS DATA SE
//***************************************************************
//STEP10   EXEC PGM=IEFBR14                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.EMPFILE.TST7,                    
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=23,BLKSIZE=230)      
//                                                              

 

JCL to allocate the new Partitioned data set(PDS) using IEFBR14.

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************************
//* JCL JOB EXECUTING THE IEFBR14 UTILTITY TO ALLOCATE PDS DATA S
//***************************************************************
//STEP10   EXEC PGM=IEFBR14                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.COBPGMS,                         
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(10,10,10),RLSE),                      
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)      
//                                                              


To delete the data set:

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//*********************************************************     
//* JCL STEP TO DELETE THE DATASET USING IEFBR14                
//*********************************************************     
//STEP20   EXEC PGM=IEFBR14                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.COBPGMS,                         
//            DISP=(OLD,DELETE,DELETE)                          
//                                                              


UTILITY PROGARM: IEBGENER

To copy PS data set to PS data set.

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE IEBGENR UTILTITY                        
//***************************************************           
//STEP10   EXEC PGM=IEBGENER                                    
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.EMPFILE,DISP=SHR                 
//SYSUT2   DD DSN=IND220.INDUS.EMPFILE.BACKUP,                  
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=23,BLKSIZE=230)      
//SYSIN    DD DUMMY                                             
//                                                              


UTILITY PROGARM: IEBCOPY

To copy PDS data set to PDS data set.

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOPY UTILTITY                       
//* TO COPY PDS TO PDS                                          
//***************************************************           
//STEP10   EXEC PGM=IEBCOPY                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.COBOL,DISP=SHR                   
//SYSUT2   DD DSN=IND220.INDUS.VIJAY.COBOL.BACKUP,              
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(10,10,10),RLSE),                      
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)      
//SYSIN    DD *                                                 
     COPY INDD=SYSUT1,OUTDD=SYSUT2                              
//                                                              


UTILITY PROGARM: IEBCOPY

To selectively copy PDS members to the another PDS.

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOPY UTILTITY                       
//* TO COPY SELECTIVE MEMBERS                                   
//***************************************************           
//STEP10   EXEC PGM=IEBCOPY                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.COBOL,DISP=SHR                   
//SYSUT2   DD DSN=IND220.INDUS.VIJAY.COBOL.TST1,                
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(10,10,10),RLSE),                      
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)      
//SYSIN    DD *                                                 
     COPY INDD=SYSUT1,OUTDD=SYSUT2                              
     SELECT MEMBER=PARMPGM,PARMPGM$                             
/*
//                                                              


To exclude some of the members

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOPY UTILTITY                       
//* TO EXCLUDE SOME OF THE MEMBERS                              
//***************************************************           
//STEP10   EXEC PGM=IEBCOPY                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.COBOL,DISP=SHR                   
//SYSUT2   DD DSN=IND220.INDUS.VIJAY.COBOL.TST2,                
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(10,10,10),RLSE),                      
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)      
//SYSIN    DD *                                                 
     COPY INDD=SYSUT1,OUTDD=SYSUT2                              
     EXCLUDE MEMBER=PARMPGM,PARMPGM$                            
//                                                              


To compress the PDS, use the same PDS in INDD and OUTDD.

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOPY UTILTITY                       
//* TO COMPRESS THE PDS DATA SET                                
//***************************************************           
//STEP10   EXEC PGM=IEBCOPY                                     
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.COBOL,DISP=SHR                   
//SYSIN    DD *                                                 
     COPY INDD=SYSUT1,OUTDD=SYSUT1                              
//                                                              
//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOMPR UTILTITY                      
//* TO COMPARE THE PDS TO PDS                                   
//***************************************************           
//STEP10   EXEC PGM=IEBCOMPR                                    
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.INDUS.COBOL,DISP=SHR                   
//SYSUT2   DD DSN=IND220.INDUS.VIJAY.COBOL.BACKUP,DISP=SHR      
//SYSIN    DD *                                                 
      COMPARE TYPORG=PO                                         
//                                                              

 

UTILITY PROGRAM: IEBCOMPR

To compare the PS to PS and PDS to PDS data sets..

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* DEMO JCL TO SHOW THE IEBCOMPR UTILTITY                      
//* TO COMPARE THE PS TO PS                                     
//***************************************************           
//STEP10   EXEC PGM=IEBCOMPR                                    
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSUT1   DD DSN=IND220.VIJAY.PS,DISP=SHR                      
//SYSUT2   DD DSN=IND220.VIJAY.PS.TST1,DISP=SHR                 
//SYSIN    DD DUMMY                                             
//                                                              


UTILITY PROGRAM: External SORT

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN   DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTOUT  DD DSN=IND220.PRIYA.COBOL.SOROUT,                    
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   SORT FIELDS=(1,3,CH,A)                                       
//                                                              


SORT


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN   DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTOUT  DD DSN=IND220.PRIYA.COBOL.EMPFILE.TST1,              
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   SORT FIELDS=COPY,                                            
   SKIPREC=2,                                                   
   STOPAFT=2                                                    
//                                                              

 

Merging the files:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN01 DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTIN02 DD DSN=IND220.PRIYA.COBOL.SORTOUT,DISP=SHR           
//SORTOUT  DD DSN=IND220.PRIYA.COBOL.MEROUT,                    
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   MERGE FIELDS=(1,3,CH,A)                                      
//                                                              


Eliminating the duplicate records in the input file.


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN   DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTOUT  DD DSN=CZA058.PRIYA.COBOL.DUPELIM.TST4,              
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   SORT FIELDS=COPY                                             
   SUM FIELDS=NONE                <========   note this                             
/*                                                              
//                                                              

 


GENERATION DATA GROUPS:

Define GDG and the model data set allocation.

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,                
//         MSGLEVEL=(1,1),REGION=6M,NOTIFY=&SYSUID              
//* JOB TO CREATE THE MODEL AND GDG INDEX                       
//STEP1    EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//MODEL    DD DSN=IND220.INDUS.MODEL.STUDENT,                   
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,0),                                    
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)      
//SYSIN    DD *                                                 
  DEFINE GDG(NAME(IND220.INDUS.STUDENT.GDG) -                   
  LIMIT(3) -                                                    
  NOEMPTY -                                                     
  SCRATCH)                                                      
/*                                                              
//                                                              


Creating the GDG versions

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=WRIPGM                                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.STUDENT.GDG(+1),                 
//         DISP=(NEW,CATLG,DELETE),                             
//         SPACE=(TRK,(1,1),RLSE),                              
//         UNIT=SYSDA,                                          
//         VOL=SER=OZAV07,                                      
//         DCB=(IND220.INDUS.MODEL.STUDENT)                     
//SYSIN    DD *                                                 
1111                                                            
VIJAY                                                           
TANUKU                                                          
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//                                                              


Define VSAM KSDS Cluster:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//* TO DEFINE THE KEY SEQUENCED DATA SET (KSDS)                 
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  DEFINE CLUSTER(NAME(IND220.INDUS.STUDENT.CLUSTER)   -         
  RECORDSIZE(44,44)    -                                        
  CYLINDERS(3,2)       -                                        
  FREESPACE(10,20)     -                                        
  KEYS(4,0)            -                                        
  CISZ(4096)           -                                        
  INDEXED)             -                                        
  INDEX(NAME(IND220.INDUS.STUDENT.INDEX)) -                     
  DATA(NAME(IND220.INDUS.STUDENT.DATA))                         
/*                                                              
//                                                              


Define VSAM ESDS Cluster:

//IND220ES JOB (123),'INDUS',MSGLEVEL=(1,1),REGION=6M,          
//             CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID                
//***************************************************           
//* SAMPLE JCL TO CREATE ENTRY SEQUENCED DATA SET(ESDS)         
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  DEFINE CLUSTER(NAME(IND220.INDUS.STUDENT.ESDS.CLUSTER)-       
  RECORDSIZE(44,44)-                                            
  CYLINDERS(3,2)-                                               
  CISZ(4096)-                                                   
  NONINDEXED) -                                                 
  DATA(NAME(IND220.INDUS.STUDENT.ESDS.DATA))                    
/*                                                              
//                                                              

 

Define VSAM RRDS Cluster:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*SAMPLE JCL TO CREATE RRDS                                    
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  DEFINE CLUSTER(NAME(IND220.INDUS.RRDS.CLUSTER)  -             
  RECORDSIZE(44,44)  -                                          
  CYLINDERS(3,2)  -                                             
  NUMBERED)  -                                                  
  DATA(NAME(IND220.INDUS.RRDS.DATA))                            
/*                                                              
//                                                              


Program to load the records into the ESDS file ...

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. ESDSWRI.                                           
 AUTHOR. INDUS COMPUTER SERVICES.                               
 INSTALLATION. INDUS, S.R.NAGAR, HYDERABAD, PH:040-66136341.    
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO AS-STUDD                        
      ORGANIZATION IS SEQUENTIAL                                
      ACCESS MODE IS SEQUENTIAL.                                
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77  OPTION PIC X(3) VALUE 'YES'.                               
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                    
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN OUTPUT STU-FILE.                                      
 WRITE-PARA.                                                    
     ACCEPT STU-NO.                                             
     ACCEPT STU-NAME.                                           
     ACCEPT STU-ADDR.                                           
     WRITE STU-REC.                                             
     ACCEPT OPTION.                                             
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            

Execution JCL for the ESDS write program

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=ESDSWRI                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUDENT.ESDS.CLUSTER,DISP=SHR    
//SYSIN    DD *                                                 
1111                                                            
VIJAYA                                                          
TANUKU                                                          
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//                                                              


Program to load the records into the KSDS file ...

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. KSDSWRI.                                           
 AUTHOR. INDUS COMPUTER SERVICES.                               
 INSTALLATION. INDUS, S.R.NAGAR, HYDERABAD, PH:040-66136341.    
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  

      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS INDEXED                                   
      ACCESS MODE IS SEQUENTIAL                                 
      RECORD KEY IS STU-NO                                      
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                    
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN OUTPUT STU-FILE.                                      
 WRITE-PARA.                                                    
     ACCEPT STU-NO.                                             
     ACCEPT STU-NAME.                                           
     ACCEPT STU-ADDR.                                           
     WRITE STU-REC INVALID KEY DISPLAY 'ERROR IN WRITE'.        
*************************************************************   
*  HOW TO USE THE STATUS CODE AND RETURN-CODE REGISTERS     *   
*************************************************************   
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD INSERTED SUCCESSFULLY'                  
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3002' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
     ACCEPT OPTION.                                             
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            


Execution JCL for the KSDS write program..

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=KSDSWRI                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUDENT.CLUSTER,DISP=SHR         
//SYSIN    DD *                                                 
1111                                                            
VIJAYA                                                          
TANUKU                                                          
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//                                                              


Program to load the records into the RRDS file ...

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. RRDSWRI.                                           
 AUTHOR. INDUS COMPUTER SERVICES.                               
 INSTALLATION. INDUS, S.R.NAGAR, HYDERABAD, PH:040-66136341.    
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS RELATIVE                                  
      ACCESS MODE IS SEQUENTIAL                                 
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                    
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN OUTPUT STU-FILE.                                      
 WRITE-PARA.                                                    
     ACCEPT STU-NO.                                             
     ACCEPT STU-NAME.                                           
     ACCEPT STU-ADDR.                                           
     WRITE STU-REC INVALID KEY DISPLAY 'ERROR IN WRITE'.        
*************************************************************   
*  HOW TO USE THE STATUS CODE AND RETURN-CODE REGISTERS     *   
*************************************************************   
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD INSERTED SUCCESSFULLY'                  
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3002' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
     ACCEPT OPTION.                                             
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            

Execution JCL for the RRDS write program

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=RRDSWRI                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.RRDS.CLUSTER,DISP=SHR            
//SYSIN    DD *                                                 
1111                                                            
VIJAYA                                                          
TANUKU                                                          
YES                                                             
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//                                                              

 

Program to read from KSDS file randomly

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. RRDSRAW.                                           
 AUTHOR. INDUS COMPUTER SERVICES.                               
 INSTALLATION. INDUS, S.R.NAGAR, HYDERABAD, PH:040-66136341.    
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS RELATIVE                                  
      ACCESS MODE IS RANDOM                                     
      RELATIVE KEY IS WS-KEY                                    
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 77 WS-KEY    PIC 9(4).                                         
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM WRITE-PARA UNTIL OPTION = 'NO'.                    
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN OUTPUT STU-FILE.                                      
 WRITE-PARA.                                                    
     DISPLAY 'ENTER THE RELATIVE KEY'.                          
     ACCEPT WS-KEY.                                             
     ACCEPT STU-NO.                                             
     ACCEPT STU-NAME.                                           
     ACCEPT STU-ADDR.                                           
     WRITE STU-REC INVALID KEY DISPLAY 'ERROR IN WRITE'.        
*************************************************************   
*  HOW TO USE THE STATUS CODE AND RETURN-CODE REGISTERS     *   
*************************************************************   
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD INSERTED SUCCESSFULLY'                  
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3002' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
     ACCEPT OPTION.                                             
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            

Execution JCL

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=RRDSRAW                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUD.RRDS.CLUSTER,DISP=SHR       
//SYSIN    DD *                                                 
0001                                                            
1111                                                            
VIJAYA                                                          
TANUKU                                                          
YES                                                             
0002                                                            
2222                                                            
BHASKAR                                                         
TANUKU                                                          
YES                                                             
0005                                                            
3333                                                            
ANDUKURI                                                        
TANUKU                                                          
NO                                                              
/*                                                              
//                                                              


Program to read the records from KSDS sequentially  ...

 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. KSDSEQR.                                           
 AUTHOR. INDUS COMPUTER SERVIES. S.R.NAGAR, HUDERABAD.          
* INDEXED FILE READING SEQUENTIALLY....                         
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS INDEXED                                   
      ACCESS MODE IS SEQUENTIAL                                 
      RECORD KEY IS STU-NO                                      
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM READ-PARA UNTIL OPTION = 'NO'.                     
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN INPUT STU-FILE.                                       
 READ-PARA.                                                     
     READ STU-FILE                                              
          AT END                                                
             MOVE 'NO' TO OPTION                                
          NOT AT END                                            
             PERFORM DISPLAY-PARA                               
     END-READ.                                                  
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD READ SUCCESSFUL'                        
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3001' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
 DISPLAY-PARA.                                                  
     DISPLAY STU-REC.                                           
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            

Execution JCL for the KSDS read program

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=KSDSSER                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSABEND DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUDENT.CLUSTER,DISP=SHR         
//                                                              
 

* INDEXED FILE READING RANDOMLY ......


 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. KSDSRAR.                                           
 AUTHOR. INDUS COMPUTER SERVIES. S.R.NAGAR, HUDERABAD.          
* INDEXED FILE READING RANDOMLY ......                          
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS INDEXED                                   
      ACCESS MODE IS RANDOM                                     
      RECORD KEY IS STU-NO                                      
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 77 WS-STU-NO     PIC 9(4) VALUE ZEROS.                         
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     PERFORM READ-PARA UNTIL OPTION = 'NO'.                     
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN INPUT STU-FILE.                                       
 READ-PARA.                                                     
     DISPLAY 'ENTER THE STUDENT NUMBER TO READ'.                
     ACCEPT WS-STU-NO.                                          
     MOVE WS-STU-NO TO STU-NO.                                  
     READ STU-FILE                                              
          INVALID KEY DISPLAY 'ERROR IN READ'                   
          NOT INVALID KEY                                       
              PERFORM DISPLAY-PARA                              
     END-READ.                                                  
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD READ SUCCESSFUL'                        
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3001' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
     DISPLAY 'DO YOU WANT TO READ MORE RECORDS:'.               
     ACCEPT OPTION.                                             
 DISPLAY-PARA.                                                  
     DISPLAY STU-REC.                                           
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            


Execution JCL


//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=KSDSRAR                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSABEND DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUDENT.CLUSTER,DISP=SHR         
//SYSIN    DD *                                                 
1111                                                            
YES                                                             
3333                                                            
NO                                                              
/*                                                              
//                                                              


* INDEXED FILE READING DYNAMICALLY....


 IDENTIFICATION DIVISION.                                       
 PROGRAM-ID. KSDSDYR.                                           
 AUTHOR. INDUS COMPUTER SERVIES. S.R.NAGAR, HUDERABAD.          
* INDEXED FILE READING DYNAMICALLY....                          
 ENVIRONMENT DIVISION.                                          
 INPUT-OUTPUT SECTION.                                          
 FILE-CONTROL.                                                  
      SELECT STU-FILE ASSIGN TO STUDD                           
      ORGANIZATION IS INDEXED                                   
      ACCESS MODE IS DYNAMIC                                    
      RECORD KEY IS STU-NO                                      
      FILE STATUS IS WS-STAT.                                   
 DATA DIVISION.                                                 
 FILE SECTION.                                                  
 FD STU-FILE.                                                   
 01 STU-REC.                                                    
     05 STU-NO    PIC 9999.                                     
     05 STU-NAME  PIC X(20).                                    
     05 STU-ADDR  PIC X(20).                                    
 WORKING-STORAGE SECTION.                                       
 77 OPTION PIC X(3) VALUE 'YES'.                                
 77 WS-STAT   PIC X(2) VALUE SPACES.                            
 77 WS-STU-NO     PIC 9(4) VALUE ZEROS.                         
 PROCEDURE DIVISION.                                            
 MAIN-PARA.                                                     
     PERFORM OPEN-PARA.                                         
     DISPLAY 'ENTER THE STUDENT NUMBER TO READ'.                
     ACCEPT WS-STU-NO.                                          
     MOVE WS-STU-NO TO STU-NO.                                  
     START STU-FILE INVALID KEY DISPLAY 'ERROR'.                
     PERFORM READ-PARA UNTIL OPTION = 'NO'.                     
     PERFORM CLOSE-PARA.                                        
     STOP RUN.                                                  
 OPEN-PARA.                                                     
     OPEN INPUT STU-FILE.                                       
 READ-PARA.                                                     
     READ STU-FILE NEXT RECORD                                  
          AT END                                                
             MOVE 'NO' TO OPTION                                
          NOT AT END                                            
              PERFORM DISPLAY-PARA                              
     END-READ.                                                  
     IF WS-STAT = '00'                                          
        DISPLAY 'RECORD READ SUCCESSFUL'                        
     ELSE                                                       
        DISPLAY 'FILE STATUS CODE IS :' WS-STAT                 
        MOVE '3001' TO RETURN-CODE                              
        DISPLAY RETURN-CODE UPON SYSOUT                         
     END-IF.                                                    
 DISPLAY-PARA.                                                  
     DISPLAY STU-REC.                                           
 CLOSE-PARA.                                                    
     CLOSE STU-FILE.                                            

Execution JCL

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//         NOTIFY=&SYSUID                                       
//STEP1    EXEC PGM=KSDSDYR                                     
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                 
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSABEND DD SYSOUT=*                                          
//STUDD    DD DSN=IND220.INDUS.STUDENT.CLUSTER,DISP=SHR         
//SYSIN    DD *                                                 
1111                                                            
/*                                                              
//                                                              


Define Alternate index

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*SAMPLE JCL TO CREATE ALTERNATE INDEX                         
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  DEFINE AIX  -                                                 
  (NAME(IND220.INDUS.STUDENT.CLUSTER.ALX) -                     
  RELATE(IND220.INDUS.STUDENT.CLUSTER) -                        
  CISZ(4096) -                                                  
  KEYS(20,4) -                                                  
  NONUNIQUEKEY -                                                
  UPGRADE-                                                      
  RECORDSIZE(29,29)-                                            
  CYLINDERS(3,2)-                                               
  FREESPACE(10,20)-                                             
  )                                                             
/*                                                              
//                                                              


Define path


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*SAMPLE JCL TO DEFINE PATH                                    
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  DEFINE PATH (NAME(IND220.INDUS.STUDENT.CLUSTER.PATH) -        
               PATHENTRY(IND220.INDUS.STUDENT.CLUSTER.ALX) UPDATE
/*                                                              
//                                                              


Build index command


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*SAMPLE JCL TO BUILD ALTERNATE INDEX                          
//***************************************************           
//STEP     EXEC PGM=IDCAMS                                      
//SYSPRINT DD  SYSOUT=*                                         
//SYSIN    DD  *                                                
  BLDINDEX -                                                    
        INDATASET(IND220.INDUS.STUDENT.CLUSTER) -               
        OUTDATASET(IND220.INDUS.STUDENT.CLUSTER.ALX)            
/*                                                              
//                                                              

 

IDCAMS print command


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*SAMPLE JCL TO PRINT/DISPLAY VSAM DATA                        
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DDIN     DD DSN=IND220.INDUS.STUDENT.CLUSTER.ALX,DISP=SHR     
//SYSIN    DD *                                                 
  PRINT -                                                       
  INFILE(DDIN) -                                                
  CHAR                                                          
/*                                                              
//                                                              


Reading KSDS fiel using alternate KEY ....

       IDENTIFICATION DIVISION.                                 
       PROGRAM-ID. KSDSAIXR.                                     
       AUTHOR. INDUS COMPUTER SERVICES.                         
       INSTALLATION. INDUS, S.R.NAGAR, HYDERABAD, PH:040-66136341
       ENVIRONMENT DIVISION.                                    
       INPUT-OUTPUT SECTION.                                    
       FILE-CONTROL.                                            
                   SELECT STU-FILE ASSIGN TO STUDMAST           
                   ORGANIZATION IS INDEXED                      
                   ACCESS MODE IS RANDOM                        
                   RECORD KEY IS STU-NO                         
                   ALTERNATE KEY IS STU-NAME WITH DUPLICATES    
                   FILE STATUS IS WS-STATUS.                    
       DATA DIVISION.                                           
       FILE SECTION.                                            
       FD STU-FILE.                                             
       01 STU-REC.                                              
              05 STU-NO PIC 9(4).                               
              05 STU-NAME PIC X(20).                            
              05 STU-ADDR PIC X(20).                            
       WORKING-STORAGE SECTION.                                 
       77 OPTION PIC X(3) VALUE 'YES'.                          
       77 WS-NAME    PIC X(20).                                 
       77 WS-STATUS  PIC XX VALUE SPACES.                       
       PROCEDURE DIVISION.                                      
       MAIN-PARA.                                               
                PERFORM OPEN-PARA.                              
                PERFORM READ-PARA UNTIL OPTION = 'NO'.          
                PERFORM CLOSE-PARA.                             
                STOP RUN.                                       
       OPEN-PARA.                                               
                OPEN INPUT STU-FILE.                            
       READ-PARA.                                               
                 DISPLAY 'ENTER THE NAME TO READ:'.             
                 ACCEPT WS-NAME.                                
                 MOVE WS-NAME TO STU-NAME.                      
                 READ STU-FILE KEY IS STU-NAME                  
                      INVALID KEY DISPLAY 'RECORD NOT FOUND'    
                      NOT INVALID                               
                          PERFORM DISPLAY-PARA                  
                 END-READ.                                      
                 IF WS-STATUS = '00'                            
                    DISPLAY 'SUCCESS'                           
                 ELSE                                           
                    DISPLAY 'WS-STATUS:' WS-STATUS              
                 END-IF.                                        
                 ACCEPT OPTION.                                 
       DISPLAY-PARA.                                            
                 DISPLAY STU-REC.                               
       CLOSE-PARA.                                              
                 CLOSE STU-FILE.                                

Execution JCL to read from the Alternate index Cluster.
Note: With the cluster we need to mention the path instead of
Mentioning the alternate index cluster.
Care should be taken while giving the ddname to path.


//IND220KS JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//STEPOZA  EXEC PGM=AIXREAD                                     
//STEPLIB  DD  DSN=IND220.INDUS.LOADLIB,DISP=SHR                
//SYSPRINT DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//STUDMAST DD  DSN=IND220.INDUS.STUDENT.CLUSTER,DISP=SHR        
//STUDMAS1 DD  DSN=IND220.INDUS.STUDENT.CLUSTER.PATH,DISP=SHR   
//SYSIN    DD  *                                                
BHASKAR                                                         
YES                                                             
ANDUKURI                                                        
NO                                                              
/*                                                              
//                                                              

 

IDCAMS ALTER COMMAND:


//IND220LC JOB (1234),'INDUS',MSGLEVEL=(1,1),REGION=6M          
//             CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID                
//*******************************************************       
//*DEMO JCL TO SHOW THE IDCAMS UTILTITY WITH ALTER OPTION       
//*******************************************************       
//STEP10   EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSIN    DD *                                                 
     ALTER IND220.INDUS.CUSTOMER.INDEX  -                       
     NEWNAME(IND220.INDUS.VIJAY.INDEX)                          
/*                                                              
//                                                              

 


//IND220LC JOB (1234),'INDUS',MSGLEVEL=(1,1),REGION=6M          
//             CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID                
//*******************************************************       
//*DEMO JCL TO SHOW THE IDCAMS UTILTITY WITH ALTER OPTION       
//*******************************************************       
//STEP10   EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSIN    DD *                                                 
     ALTER IND220.INDUS.VIJAY.DATA  -                           
     ADDVOLUMES(OZAV05) -                                       
     REMOVEVOLUMES(OZAV11)                                      
/*                                                              
//                                                              

 

//IND220LC JOB (1234),'INDUS',MSGLEVEL=(1,1),REGION=6M          
//             CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID                
//**************************************************************
//* ALTER THE FREESPACE PARAMETERS USING THE IDCAMS UTILITY     
//**************************************************************
//STEP10   EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSIN    DD *                                                 
     ALTER IND220.INDUS.VIJAY.DATA  -                           
     FREESPACE(30 30)                                           
/*                                                              
//                                                              

                                                             
       IND220.INDUS.SUTDENT.PSFILE                              
                                                                
=COLS> ----+----1----+----2----+----3----+----4----             
000001 1111AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA             
000002 2222BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB             
000003 3333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC             
000004 4444DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD             
000005 5555EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE             
000006 6666FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF             
000007 7777GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG             
000008 8888HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH             
000009 9999IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII             
                                                                


IDCAMS REPRO COMMAND:


//IND220EX JOB (1234),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//*SAMPLE JCL REPRO/COPY DATA FROM PS TO VSAM KSDS              
//* USING REPOR WE CAN COPY ANY FILE TO ANY FILE                
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD  *                                                
  REPRO -                                                       
  INDATASET(IND220.INDUS.SUTDENT.PSFILE) -                      
  OUTDATASET(IND220.INDUS.SUTDENT.KSDS.CLUSTER) -               
  SKIP(3) -                                                     
  COUNT(3)                                                      
/*                                                              
//                                                              

 

//IND220EX JOB (1234),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* SAMPLE JCL REPRO/COPY DATA FROM VSAM KSDS TO PS             
//* USING REPOR WE CAN COPY ANY FILE TO ANY FILE                
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DD1      DD DSN=IND220.INDUS.SUTDENT.KSDS.CLUSTER,DISP=SHR    
//DD2      DD DSN=IND220.INDUS.SUTDENT.PSFILE.TST1,             
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)      
//SYSIN    DD  *                                                
  REPRO -                                                       
  INFILE(DD1) -                                                 
  OUTFILE(DD2) -                                                
  FROMKEY(4444) -                                               
  TOKEY(5555)                                                   
/*                                                              
//                                                              

 

IDCAMS PRINT COMMAND:

//IND220PR JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* SAMPLE JCL TO PRINT/DISPLAY VSAM DATA                       
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//DDIN     DD DSN=IND220.INDUS.SUTDENT.KSDS.CLUSTER,DISP=SHR    
//SYSIN    DD *                                                 
  PRINT -                                                       
  INFILE(DDIN) -                                                
  CHAR                                                          
/*                                                              
//                                                              

 

//IND220PR JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//* SAMPLE JCL TO PRINT/DISPLAY VSAM DATA                       
//***************************************************           
//STEPOZA  EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSIN    DD *                                                 
  PRINT -                                                       
  INDATASET(IND220.INDUS.SUTDENT.KSDS.CLUSTER) -                
  FROMKEY(4444) -                                               
  TOKEY(5555) -                                                 
  HEX                                                           
/*                                                              
//                                                              


IDCAMS LISTCAT COMMAND:

//IND220LC JOB (1123),CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID,REGION=6M                         
//***************************************************           
//*DEMO JCL TO SHOW THE IEBGENR UTILTITY                        
//***************************************************           
//STEP10   EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SYSIN    DD *                                                 
     LISTCAT ENTRIES(IND220.INDUS.CUSTOMER.CLUSTER) -           
     VOLUME                                                     
/*                                                              
//                                                              

 

EXPORT COMMAND


//SSS013EX JOB (20,FB3),PARAMESH,CLASS=A,MSGLEVEL=(1,1),TIME=20,
//            NOTIFY=&SYSUID,MSGLEVEL=A,REGION=6M               
//STEP1    EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//DD1      DD DSN=SSS013.PARA2.KSDS.BACKUP,                     
//            DISP=(NEW,CATLG,DELETE),                          
//            UNIT=SYSDA,                                       
//            DCB=(BLKSIZE=8000)                                
//SYSIN    DD *                                                 
  EXPORT -                                                      
  SSS013.PARA2.KSDS.CLUSTER    -                                
  OUTFILE(DD1)                 -                                
  TEMPORARY                    -                                
  INHIBITSOURCE                -                                
  INHIBITTARGET                                                 
/*                                                              
                                                                

IMPORT COMMAND                                                             
                                                                
//SSS013IM JOB (20,FB3),PARAMESH,CLASS=A,MSGCLASS=A,TIME=20,    
//            MSGLEVEL=(1,1),NOTIFY=&SYSUID,REGION=6M           
//*THIS IMPORT AND EXPORT COMMAND USED ONLY FOR VSAMFILE.       
//STEP1    DD DSN=IDCAMS                                        
//SYSPRINT DD SYSOUT=*                                          
//DD1      DD DSN=SSS013.STU.KSDS.BACKUP,                       
//            DISP=SHR                                          
//SYSIN    DD *                                                 
  IMPORT -                                                      
  INFILE(DD1) -                                                 
  OUTDATASET(SSS013.STU.KSDS.CLUSTER)                           
/*                                                              
//                                                              
                                                                


ALTER COMMND                                                                
                                                                
 //SSS013MO JOB (20,FB3),PARAMESH,CLASS=A,MEGCLASS=A,TIME=20,   
 //            MSGLEVEL=(1,1),NOTIFY=&SYSUID,REGION=6M          
 //STEP1      EXEC PGM=IDCAMS                                   
 //SYSPRINT DD SYSOUT=*                                         
 //SYSIN    DD *                                                
   ALTER -                                                      
   COBOL.LOAD(PROGRAM1) -                                       
   NEWNAME(COBOL.LOAD(PROGRAM2))                                
 /*                                                             
 //                                                             
                                                                

MODEL COMMANDS                                                                
                                                              
//SSS032MO JOB (20,FB3),PARAMESH,CLASS=A,MEGCLASS=A,TIME=20,    
//            MSGLEVEL=(1,1),NOTIFY=&SYSUID,REGION=6M           
STEP1      EXEC PGM=IDCAMS                                      
//SYSPRINT DD SYSOUT=*                                          
//SYSIN    DD *                                                 
  REPRO -                                                       
  INDATASET(SSS013.STU.PS) -                                    
  OUTDATASET(SSS013.STU.KSDS)                                   
  IF LASTCC = 0                                                 
      THEN                                                      
         DELETE (SSS013.STU.PS)                                 
/*                                                              
//                                                              
                                                                

Compile JCL’S:


COBOL program compile JCL:

//IND220CL JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),        
//             NOTIFY=&SYSUID,REGION=6M                                
//************************************************************         
//* CHANGE THE MEM NAME TO YOUR PRORAM NAME                            
//* CHANGE THE SYSIN LIBRARY AS YOUR PROGRAM LIBRARY                   
//* CHANGE THE SYSLIB LIBRARY AS YOUR COPY LIBRARY                     
//* CHANGE THE SYSLMOD LIBRARY AS YOUR LOAD MODULE LIBRARY             
//************************************************************         
//JOBPROC  JCLLIB ORDER=IND120.INDUS.PROCLIB                             
//COBCL    EXEC COBCL,MEM=KSDSDYR                                      
//COMPILE.SYSIN  DD  DSN=IND220.INDUS.COBOL(&MEM),DISP=SHR             
//COMPILE.SYSLIB DD  DSN=IND220.INDUS.COPYLIB,DISP=SHR                 
//LKED.SYSLMOD DD  DSN=IND220.INDUS.LOADLIB(&MEM),DISP=SHR             
//                                                                     

Compile procedure:


//COBCL PROC LNGPRFX='IGY',SYSLBLK=0000,LIBPRFX='CEE'                  
//*                                                                    
//COMPILE  EXEC PGM=IGYCRCTL,REGION=2048K,                             
//         PARM='RES,LIB,OBJECT,APOST,TEST,DYNAM,LIST'                 
//STEPLIB  DD  DSNAME=&LNGPRFX..SIGYCOMP,DISP=SHR                      
//SYSPRINT DD  SYSOUT=*                                                
//SYSLIN   DD  DSNAME=&&LOADSET,UNIT=SYSALLDA,                         
//             DISP=(MOD,PASS),SPACE=(TRK,(3,3)),                      
//             DCB=(BLKSIZE=&SYSLBLK)                                  
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT2   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT3   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT4   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT5   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT6   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//SYSUT7   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                         
//*                                                                    
//LKED   EXEC PGM=HEWL,COND=(8,LT,COMPILE),REGION=1024K,PARM='XREF'    
//SYSLIB   DD  DSNAME=&LIBPRFX..SCEELKED,DISP=SHR                      
//SYSPRINT DD  SYSOUT=*                                                
//SYSLIN   DD  DSNAME=&&LOADSET,DISP=(OLD,DELETE)                      
//         DD  DDNAME=SYSIN                                            
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(TRK,(10,10))                       

 

COBOL + CICS program compile JCL:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************                  
//JOBPROC  JCLLIB ORDER=IND220.INDUS.PROCLIB                           
//CICSCOB  EXEC CICSCOB,                                               
//             COPYLIB=IND220.INDUS.COPYLIB,                           
//             LOADLIB=IND220.INDUS.LOADLIB                            
//TRN.SYSIN  DD DSN=IND220.INDUS.CICS(CUSTINQ3),DISP=SHR               
//LKED.SYSLIB DD                                                       
//            DD                                                       
//            DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                     
//LKED.SYSIN DD  *                                                     
  NAME CUSTINQ3(R)                                                     
//                                                                     
                                                                       
compile procedure
                      
//CICSCOB  PROC OUTC=*,              CLASS FOR PRINT OUTPUT            
//       COPYLIB='JCLERROR',         PRIVATE COPY LIBRARY              
//       LOADLIB='JCLERROR'          OUTPUT LOAD LIBRARY               
//*                                                                    
//*                                                                    
//*      THIS PROCEDURE CONTAINS 4 STEPS                               
//*      1.   EXEC THE COBOL TRANSLATOR                                
//*           (USING THE SUPPLIED SUFFIX 1$)                           
//*      2.   EXEC THE COBOL COMPILER                                  
//*      3.   REBLOCK SDFHC370(DFHEILID) FOR USE BY THE LINKEDIT STEP  
//*      4.   LINKEDIT THE OUTPUT INTO DATASET &LOADLIB                
//*                                                                    
//*      THE FOLLOWING JCL SHOULD BE USED                              
//*      TO EXECUTE THIS PROCEDURE                                     
//*                                                                    
//*      //APPLPROG EXEC DFHYITVL                                      
//*      //TRN.SYSIN  DD *                                             
//*         .                                                          
//*         . APPLICATION PROGRAM                                      
//*         .                                                          
//*      /*                                                            
//*      //LKED.SYSIN DD *                                             
//*         NAME ANYNAME(R)                                            
//*      /*                                                            
//*                                                                    
//*      WHERE   ANYNAME   IS THE NAME OF YOUR APPLICATION PROGRAM.    
//*      (REFER TO THE SYSTEM DEFINITION GUIDE FOR FULL DETAILS,       
//*      INCLUDING WHAT TO DO IF YOUR PROGRAM CONTAINS CALLS TO        
//*      THE COMMON PROGRAMMING INTERFACE.)                            
//*                                                                    
//TRN    EXEC PGM=DFHECP1$,                                            
//            PARM='COBOL3',                                           
//            REGION=4M                                                
//STEPLIB  DD DSN=CICSTS23.CICS.SDFHLOAD,DISP=SHR                      
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSPUNCH DD DSN=&&SYSCIN,                                            
//            DISP=(,PASS),UNIT=SYSDA,                                 
//            DCB=BLKSIZE=400,                                         
//            SPACE=(400,(400,100))                                    
//*                                                                    
//COB    EXEC PGM=IGYCRCTL,REGION=4M,                                  
//  PARM='NODYNAM,LIB,OBJECT,RES,APOST,MAP,XREF,NOSEQUENCE'            
//STEPLIB  DD DSN=IGY.SIGYCOMP,DISP=SHR                                
//SYSLIB   DD DSN=&COPYLIB,DISP=SHR                                    
//         DD DSN=CICSTS23.CICS.SDFHCOB,DISP=SHR                       
//         DD DSN=CICSTS23.CICS.SDFHMAC,DISP=SHR                       
//         DD DSN=CICSTS23.CICS.SDFHSAMP,DISP=SHR                      
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSIN    DD DSN=&&SYSCIN,DISP=(OLD,DELETE)                           
//SYSLIN   DD DSN=&&LOADSET,DISP=(MOD,PASS),                           
//            UNIT=SYSDA,SPACE=(80,(250,100))                          
//SYSUT1   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT2   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT3   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT4   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT5   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT6   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT7   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//*                                                                    
//COPYLINK EXEC PGM=IEBGENER,COND=(7,LT,COB)                           
//SYSUT1   DD DSN=CICSTS23.CICS.SDFHSAMP(DFHEILID),DISP=SHR            
//SYSUT2   DD DSN=&&COPYLINK,DISP=(NEW,PASS),                          
//            DCB=(LRECL=80,BLKSIZE=400,RECFM=FB),                     
//            UNIT=SYSDA,SPACE=(400,(20,20))                           
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSIN    DD DUMMY                                                    
//*                                                                    
//LKED   EXEC PGM=IEWL,REGION=4M,                                      
//            PARM='LIST,XREF',COND=(5,LT,COB)                         
//SYSLIB   DD DSN=CICSTS23.CICS.SDFHLOAD,DISP=SHR                      
//         DD DSN=CEE.SCEELKED,DISP=SHR                                
//SYSLMOD  DD DSN=&LOADLIB,DISP=SHR                                    
//SYSUT1   DD UNIT=SYSDA,DCB=BLKSIZE=1024,                             
//            SPACE=(1024,(200,20))                                    
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSLIN   DD DSN=&&COPYLINK,DISP=(OLD,DELETE)                         
//         DD DSN=&&LOADSET,DISP=(OLD,DELETE)                          
//         DD DDNAME=SYSIN                                             

 

Map compile JCL:


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************                  
//JOBPROC  JCLLIB ORDER=IND120.INDUS.PROCLIB                             
//CICSMAP  EXEC CICSMAP,                                               
//         OUTC=*,                                                     
//         COPYLIB=IND220.INDUS.COPYLIB,     *CICS MAP COPYLIB         
//         LOADLIB=IND220.INDUS.LOADLIB,                               
//         MAPNAME=MENSET1                 *NAME OF MAPSET             
//COPY.SYSUT1  DD  DSN=IND220.INDUS.MAPLIB(ANIL1),DISP=SHR             
//                                                                     
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&                    
//DFHMAPS PROC INDEX='CICSTS23.CICS', FOR SDFHMAC                      
//             LOADLIB='JCLERROR',           TARGET LOADLIB FOR MAP    
//             COPYLIB='JCLERROR',           TARGET COPYLIB FOR DSECT  
//             MAPNAME='MAPCICS',              NAME OF MAPSET - REQUIRED
//             A=,                           A=A FOR ALIGNED MAP       
//             RMODE=24,                     24/ANY                    
//             ASMBLR=ASMA90,                ASSEMBLER PROGRAM NAME    
//             REG=2048K,                    REGION FOR ASSEMBLY       
//             OUTC='*',                     PRINT SYSOUT CLASS        
//             WORK=SYSDA                    WORK FILE UNIT            
//COPY     EXEC PGM=IEBGENER                                           
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSUT2   DD DSN=&&TEMPM,UNIT=&WORK,DISP=(,PASS),                     
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=400),                     
//            SPACE=(400,(50,50))                                      

//SYSIN    DD DUMMY                                                    
//*SYSUT1 DD * NEEDED FOR THE MAP SOURCE                               
//ASMMAP   EXEC PGM=&ASMBLR,REGION=&REG,                               
//* NOLOAD CHANGED TO NOOBJECT                                         
//  PARM='SYSPARM(&A.MAP),DECK,NOOBJECT'                               
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSLIB   DD DSN=&INDEX..SDFHMAC,DISP=SHR                             
//         DD DSN=SYS1.MACLIB,DISP=SHR                                 
//SYSUT1   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSUT2   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSUT3   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSPUNCH DD DSN=&&MAP,DISP=(,PASS),UNIT=&WORK,                       
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=400),                     
//            SPACE=(400,(50,50))                                      
//SYSIN    DD DSN=&&TEMPM,DISP=(OLD,PASS)                              
//LINKMAP  EXEC PGM=IEWL,PARM='LIST,LET,XREF,RMODE(&RMODE)'            
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSLMOD  DD DSN=&LOADLIB(&MAPNAME),DISP=SHR                          
//SYSUT1   DD UNIT=&WORK,SPACE=(1024,(20,20))                          
//SYSLIN   DD DSN=&&MAP,DISP=(OLD,DELETE)                              
//* NOLOAD CHANGED TO NOOBJECT                                         
//ASMDSECT EXEC PGM=&ASMBLR,REGION=&REG,                               
//  PARM='SYSPARM(&A.DSECT),DECK,NOOBJECT'                             
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSLIB   DD DSN=&INDEX..SDFHMAC,DISP=SHR                             
//         DD DSN=SYS1.MACLIB,DISP=SHR                                 
//SYSUT1   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSUT2   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSUT3   DD UNIT=&WORK,SPACE=(CYL,(5,5))                             
//SYSPUNCH DD DSN=&COPYLIB(&MAPNAME),DISP=OLD                          
//SYSIN    DD DSN=&&TEMPM,DISP=(OLD,DELETE)                            

 

COBOL + DB2 + CICS compile JCL:


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************                  
//JOBPROC  JCLLIB ORDER=IND120.INDUS.PROCLIB                             
//DB2CICS  EXEC DB2CICS,                                               
//             DBRMLIB='IND220.INDUS.DBRMLIB',                         
//             DB2COPY='IND220.INDUS.COPYLIB',                         
//             COPYLIB='IND220.INDUS.COPYLIB',                         
//             LOADLIB='IND220.INDUS.LOADLIB',                         
//             MEM=CICDB202    * SHOULD BE SAME AS PROGRAM NAME        
//SYSIN    DD  DSN=IND220.INDUS.DB2(CICDB202),DISP=SHR                 
//LKED.SYSIN    DD  *                                                  
  INCLUDE SYSLIB(DSNCLI)                                               
  NAME CICDB202(R)                                                     
//                                                                     


compile procedure


//DB2CICS  PROC OUTC=*,              CLASS FOR PRINT OUTPUT            
//       DB2COPY='JCLERROR',         NAME OF DB2 DCLGEN COPY LIBRARY   
//       DBRMLIB='JCLERROR',         NAME OF DB2 DBRM LIBRARY          
//       COPYLIB='JCLERROR',         NAME OF PUBPLC COPY LIBRARY       
//       LOADLIB='JCLERROR',         NAME OF OUTPUT LOAD LIBRARY       
//       MEM=TEMPNAME                                                  
//*                                                                    
//*      THIS PROCEDURE CONTAINS 5 STEPS                               
//*      1.   EXEC THE DB2 COBOL PRECOMPILER                           
//*      2.   EXEC THE CICS COBOL TRANSLATOR                           
//*      3.   EXEC THE IBM COBOL FOR OS/390 COMPILER                   
//*      5.   REBLOCK STUB FOR USE BY THE LINKEDIT STEP                
//*      6.   LINKEDIT THE OUTPUT INTO DATASET &LOADLIB                
//*                                                                    
//*      THE FOLLOWING JCL SHOULD BE USED                              
//*      TO EXECUTE THIS PROCEDURE                                     
//*                                                                    
//*      //APPLPROG EXEC DB2CICS                                       
//*      //DB2PC.SYSIN  DD *                                           
//*         .                                                          
//*         . APPLICATION PROGRAM                                      
//*         .                                                          
//*      /*                                                            
//*      //LKED.SYSIN DD *                                             
//*         NAME ANYNAME(R)                                            
//*      /*                                                            
//*                                                                    
//*      WHERE   ANYNAME   IS THE NAME OF YOUR APPLICATION PROGRAM.    
//*      (REFER TO THE SYSTEM DEFINITION GUIDE FOR FULL DETAILS,       
//*      INCLUDING WHAT TO DO IF YOUR PROGRAM CONTAINS CALLS TO        
//*      THE COMMON PROGRAMMING INTERFACE.)                            
//*                                                                    

//DB2COB   EXEC PGM=DSNHPC,PARM='HOST(IBMCOB),NOSOURCE,APOST,APOSTSQL',
//       REGION=2M                                                     
//*********************************************************************
//*            PRECOMPILE THE COBOL PROGRAM FOR DB2                    
//*********************************************************************
//STEPLIB  DD  DISP=SHR,DSN=DSN710.SDSNEXIT                            
//         DD  DISP=SHR,DSN=DSN710.SDSNLOAD                            
//SYSLIB   DD  DSN=&DB2COPY,DISP=SHR                                   
//SYSCIN   DD  DSN=&&DSNHOUT,DISP=(MOD,PASS),                          
//             UNIT=SYSDA,SPACE=(800,(400,400),,,ROUND)                
//DBRMLIB  DD  DSN=&DBRMLIB(&MEM),DISP=SHR                             
//SYSPRINT DD  SYSOUT=&OUTC                                            
//SYSTERM  DD  SYSOUT=*                                                
//SYSUDUMP DD  SYSOUT=*                                                
//SYSUT1   DD  SPACE=(800,(400,400),,,ROUND),UNIT=SYSDA                
//SYSUT2   DD  SPACE=(800,(400,400),,,ROUND),UNIT=SYSDA                
//*                                                                    
//TRN    EXEC PGM=DFHECP1$,                                            
//            COND=(4,LT,DB2COB),                                      
//            PARM='COBOL3',                                           
//            REGION=2M                                                
//STEPLIB  DD DSN=CICSTS23.CICS.SDFHLOAD,DISP=SHR                      
//SYSIN    DD DSN=&&DSNHOUT,DISP=(OLD,DELETE)                          
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSPUNCH DD DSN=&&SYSCIN,                                            
//            DISP=(,PASS),UNIT=SYSDA,                                 
//            DCB=BLKSIZE=400,                                         
//            SPACE=(400,(400,100))                                    
//*                                                                    
//COB    EXEC PGM=IGYCRCTL,REGION=2M,                                  
//       PARM='NODYNAM,LIB,OBJECT,RENT,APOST,MAP,XREF'                 
//STEPLIB  DD DSN=IGY.SIGYCOMP,DISP=SHR                                
//SYSLIB   DD DSN=&COPYLIB,DISP=SHR                                    
//         DD DSN=CICSTS23.CICS.SDFHCOB,DISP=SHR                       
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSIN    DD DSN=&&SYSCIN,DISP=(OLD,DELETE)                           
//SYSLIN   DD DSN=&&LOADSET,DISP=(MOD,PASS),                           
//            UNIT=SYSDA,SPACE=(80,(250,100))                          
//SYSUT1   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT2   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT3   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT4   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT5   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT6   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//SYSUT7   DD UNIT=SYSDA,SPACE=(460,(350,100))                         
//*                                                                    
//COPYLINK EXEC PGM=IEBGENER,COND=(7,LT,COB)                           
//SYSUT1   DD DSN=CICSTS23.CICS.SDFHSAMP(DFHEILID),DISP=SHR            

//SYSUT2   DD DSN=&&COPYLINK,DISP=(NEW,PASS),                          
//            DCB=(LRECL=80,BLKSIZE=400,RECFM=FB),                     
//            UNIT=SYSDA,SPACE=(400,(20,20))                           
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSIN    DD DUMMY                                                    
//*                                                                    
//*                                                                    
//LKED   EXEC PGM=IEWL,REGION=2M,                                      
//            PARM='LIST,XREF',COND=(5,LT,COB)                         
//SYSLIB   DD DSN=CICSTS23.CICS.SDFHLOAD,DISP=SHR                      
//         DD DSN=CEE.SCEELKED,DISP=SHR                                
//         DD DSN=&LOADLIB,DISP=SHR                                    
//         DD DSN=DSN710.SDSNEXIT,DISP=SHR                             
//         DD DSN=DSN710.SDSNLOAD,DISP=SHR                             
//SYSLMOD  DD DSN=&LOADLIB,DISP=SHR                                    
//SYSUT1   DD UNIT=SYSDA,DCB=BLKSIZE=1024,                             
//            SPACE=(1024,(200,20))                                    
//SYSPRINT DD SYSOUT=&OUTC                                             
//SYSLIN   DD DSN=&&COPYLINK,DISP=(OLD,DELETE)                         
//         DD DSN=&&LOADSET,DISP=(OLD,DELETE)                          
//         DD DDNAME=SYSIN                                             

 


Bind JCL:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************                  
//JOBLIB   DD DISP=SHR,DSN=DSN710.SDSNEXIT                             
//         DD DISP=SHR,DSN=DSN710.SDSNLOAD                             
//         DD DISP=SHR,DSN=CEE.SCEERUN                                 
//BINDPLAN EXEC PGM=IKJEFT01,DYNAMNBR=20                               
//DBRMLIB  DD DSN=IND220.INDUS.DBRMLIB,DISP=SHR                        
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSIN DD *   PLAN,DBRM AND PROGRAM NAMES SHOULD BE SAME            
 DSN SYSTEM(DSN)                                                       
  BIND PLAN(CICDB202) MEMBER(CICDB202) ACT(REP) ISOLATION(CS) -        
                      QUALIFIER(IND220) OWNER(IND220)                  
 END                                                                   
//                                                                     
//                                                                     

 

COBOL + DB2 compile JCL:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//**********************************************************           
//JOBPROC  JCLLIB ORDER=IND120.INDUS.PROCLIB                             
//DB2ICOB  EXEC PRECLINK,                                              
//    COPYLIB='IND220.SREE.DCLGEN',                                    
//    DBRMLIB='IND220.SREE.DBRMLIB',                                   
//    LOADLIB='IND220.SREE.LOADLIB',                                   
//    MEM=INSPGM,                                                      
//    LMOD=INSPGM                                                      
//SYSIN DD  DSN=IND220.SREE.DB2(INSPGM),DISP=SHR                       
//LKED.SYSIN   DD *                                                    
       INCLUDE SYSLIB(DSNELI)                                          
/*                                                                     
//                                                                     

 

compile procedure:


//DB2COB   PROC MEM=TEMPNAME,                                          
//             COPYLIB=JCLERROR,                                       
//             DBRMLIB=JCLERROR,                                       
//             LOADLIB=JCLERROR,                                       
//             LMOD=JCLERROR,                                          
//             WSPC=500,LNGPRFX='IGY',                                 
//             LIBPRFX='CEE'                     *QUALIFIER FOR LE/390 
//******************************************************************** 
//*        PRECOMPILE THE IBM COBOL PROGRAM                          * 
//******************************************************************** 
//PC       EXEC PGM=DSNHPC,                                            
//         PARM='HOST(COBOL),SOURCE'                                   
//DBRMLIB  DD DSN=&DBRMLIB(&MEM),DISP=SHR                              
//STEPLIB  DD DISP=SHR,DSN=DSN710.SDSNEXIT                             
//         DD DISP=SHR,DSN=DSN710.SDSNLOAD                             
//SYSLIB   DD DSN=&COPYLIB,DISP=SHR                                    
//SYSCIN   DD DSN=&&DSNHOUT,DISP=(MOD,PASS),UNIT=SYSDA,                
//            SPACE=(800,(&WSPC,&WSPC))                                
//SYSPRINT DD SYSOUT=*                                                 
//SYSTERM  DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSUT1   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT2   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//******************************************************************** 
//*        COMPILE THE IBM COBOL PROGRAM IF THE PRECOMPILE           * 
//*        RETURN CODE IS 4 OR LESS.                                 * 
//******************************************************************** 
//COB      EXEC PGM=IGYCRCTL,                                          
//            PARM='APOST',                                            
//            COND=(4,LT,PC)                                           
//STEPLIB DD DSN=&LNGPRFX..SIGYCOMP,DISP=SHR                           
//SYSPRINT DD SYSOUT=*                                                 
//SYSTERM  DD SYSOUT=*                                                 
//SYSLIB   DD DSN=&COPYLIB,DISP=SHR                                    
//SYSLIN   DD DSN=&&LOADSET,DISP=(MOD,PASS),                           
//            SPACE=(800,(&WSPC,&WSPC))                                
//SYSIN    DD DSN=&&DSNHOUT,DISP=(OLD,DELETE)                          
//SYSUT1   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT2   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT3   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT4   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT5   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT6   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//SYSUT7   DD SPACE=(800,(&WSPC,&WSPC),,,ROUND)                        
//******************************************************************** 
//*        LINKEDIT IF THE PRECOMPILE AND COMPILE                    * 
//*        RETURN CODES ARE 4 OR LESS.                               * 
//******************************************************************** 
//LKED     EXEC PGM=IEWL,                                              
//         COND=((4,LT,PC),(4,LT,COB))                                 
//SYSLIB   DD DSN=&LIBPRFX..SCEELKED,DISP=SHR                          
//         DD DISP=SHR,DSN=DSN710.SDSNLOAD                             
//SYSLIN   DD DSN=&&LOADSET,DISP=(OLD,DELETE)                          
//         DD DDNAME=SYSIN                                             
//SYSLMOD  DD DSN=&LOADLIB(&LMOD),DISP=SHR                             
//SYSPRINT DD SYSOUT=*                                                 
//SYSUT1   DD SPACE=(1024,(50,50))                                     

 

Bind jcl:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//******************************************************               
//JOBLIB   DD DISP=SHR,DSN=DSN710.SDSNEXIT                             
//         DD DISP=SHR,DSN=DSN710.SDSNLOAD                             
//         DD DISP=SHR,DSN=CEE.SCEERUN                                 
//BINDPLAN EXEC PGM=IKJEFT01,DYNAMNBR=20                               
//DBRMLIB  DD DSN=IND220.SREE.DBRMLIB,DISP=SHR                         
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//******************************************************               
//*STATEMENTS FOR PROGRAM DB2VSAM IN OZASUP.SUP.SOURCE                 
//SYSTSIN DD *                                                         
 DSN SYSTEM(DSN)                                                       
 BIND PLAN(INSPGM) MEMBER(INSPGM) ACT(REP)-                            
      ISOLATION(CS)                                                    
 END                                                                   
/*                                                                     
//                                                                     
                                                                       

COBOL + DB2 execution JCL:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//******************************************************               
//JOBLIB   DD DISP=SHR,DSN=DSN710.SDSNEXIT                             
//         DD DISP=SHR,DSN=DSN710.SDSNLOAD                             
//         DD DISP=SHR,DSN=CEE.SCEERUN                                 
//BINDPLAN EXEC PGM=IKJEFT01,DYNAMNBR=20                               
//DBRMLIB  DD DSN=IND220.SREE.DBRMLIB,DISP=SHR                         
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//******************************************************               
//*STATEMENTS FOR PROGRAM DB2VSAM IN OZASUP.SUP.SOURCE                 
//SYSTSIN DD *                                                         
 DSN SYSTEM(DSN)                                                       
 RUN PROGRAM(INSPGM) –
     PLAN(INSPGM) –
     LIB(‘IND220.INDUS.LOADLIB’)
 END                                                                   
/*                                                                     
//                                                                


PROCEDURES:

Instream procedures:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************            
//INPROC   PROC                                                  
//STEP1    EXEC PGM=DISPGM                                       
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                  
//SYSPRINT DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//                PEND                                                  
//STEP2    EXEC PROC=INPROC                                      
//STEP3    EXEC INPROC                                           
//                                                                

Cataloged procedures:
Cataloged proc is the member in a proc library.

IND220.INDUS.PROCLIB(CATPROC)

//CATPROC  PROC                                 
//STEP1    EXEC PGM=DISPGM                      
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR 
//SYSPRINT DD SYSOUT=*                          
//SYSOUT   DD SYSOUT=*                          

 

Invoking JCL:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************          
//PROCLIB  JCLLIB ORDER=(IND220.INDUS.PROCLIB)                 
//STEP2    EXEC PROC=CATPROC                                   
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=*                                         
//                                                             

 

Parameters overriding and symbolic parameters:

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),  
//             NOTIFY=&SYSUID                                        
//PROC1    PROC                                                  
//STEP1    EXEC PGM=SEQWRI                                       
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR                  
//SYSPRINT DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//STUDD    DD DSN=IND220.INDUS.STUDENT.PSFILE.TST,               
//            DISP=(NEW,CATLG,DELETE),                           
//            SPACE=(&UNI,(&PRI,&SEC),RLSE),                     
//            UNIT=SYSDA,                                        
//            DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)       
//SYSIN    DD DSN=IND220.INDUS.CTLCARDS(CTL90),DISP=SHR          
//         PEND                                                  
//STEP2    EXEC PROC1,UNI=TRK,PRI=1,SEC=1                        
//STEP1.STUDD DD DSN=IND220.INDUS.STUDENT.PSFILE.TST5            
//                                                               

 

Parameters overriding, symbolic parameters and the SET statement:

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 
//              NOTIFY=&SYSUID                                       
//         SET UNI=TRK,                                         
//         PRI=1,                                           
//         SEC=1                                            
//PROCLIB  JCLLIB ORDER=(IND220.INDUS.PROCLIB)                  
//STEP2    EXEC CATOVER                                         
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//STEP1.STUDD DD DSN=IND220.INDUS.STUDENT.PSFILE.TST6           
//                                                              

 

cataloged procedure:

//CATOVER  PROC                                              
//STEP1    EXEC PGM=SEQWRI                                   
//STEPLIB  DD DSN=IND220.INDUS.LOADLIB,DISP=SHR              
//SYSPRINT DD SYSOUT=*                                       
//SYSOUT   DD SYSOUT=*                                       
//STUDD    DD DSN=IND220.INDUS.STUDENT.PSFILE.TST,           
//            DISP=(NEW,CATLG,DELETE),                       
//            SPACE=(&UNI,(&PRI,&SEC),RLSE),                 
//            UNIT=SYSDA,                                    
//            DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)   
//SYSIN    DD DSN=IND220.INDUS.CTLCARDS(CTL90),DISP=SHR  

 http://www.mainframesguru.com


The gadget you added is not valid

Comments