Monday, September 26, 2011

COBOL : Test your COBOL code before implementing it using this simple job

If you have any doubt in COBOL syntax, or if you are not sure if your logic will work or not,  then you can use the below simple job to test that. All you have to do this code your logic, in the first step and submit the job to see if it works. The first step in this job, is a compile step, and second step will link edit and run the program.


//COBJ     JOB ('23232'),'TEST',CLASS=A,PRTY=15,        
// MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID                 
//*                                                         
//COB2 EXEC PGM=IGYCRCTL,PARM='LIST,LIB'                    
//SYSIN DD *                                                
       IDENTIFICATION DIVISION.                             
       PROGRAM-ID. FINGFIXA.                                
       ENVIRONMENT DIVISION.                                
       INPUT-OUTPUT SECTION.                                
       FILE-CONTROL.                                        
       DATA DIVISION.                                       
       WORKING-STORAGE SECTION.                             
       PROCEDURE DIVISION.                                  
           DISPLAY 'TEST PROGRAM'.                          
           GOBACK.                                          
//*                                                         
//SYSPRINT DD SYSOUT=*                                       
//SYSUT1 DD SPACE=(CYL,(10,10),RLSE)                        
//SYSUT2 DD SPACE=(CYL,(10,10),RLSE)                        
//SYSUT3 DD SPACE=(CYL,(10,10),RLSE)                          
//SYSUT4 DD SPACE=(CYL,(10,10),RLSE)                          
//SYSUT5 DD SPACE=(CYL,(10,10),RLSE)                          
//SYSUT6 DD SPACE=(CYL,(10,10),RLSE)                          
//SYSUT7 DD SPACE=(CYL,(10,10),RLSE)                          
//SYSLIB DD DSN= copy lib...
//SYSLIN DD SPACE=(CYL,(10,10)),DISP=(,PASS),BLKSIZE=3200     
//*                                                           
//GO    EXEC PGM=LOADER,PARM=PRINT                            
//SYSLIN   DD DISP=(OLD,PASS),DSN=*.COB2.SYSLIN               
//SYSLIB   DD DISP=SHR,DSN=SYS1.SCEELKED                      
//SYSLOUT DD SYSOUT=*                                         
//SYSOUT DD SYSOUT=*                                          
//*                                                           

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.