Tuesday, 12 February 2013

JCL to Run simple cobol program - 

//YSWATEST JOB (GENERAL),'RUN JCL',CLASS=A,                 
//         MSGCLASS=Q,                                      
//         NOTIFY=&SYSUID,                                  
//         TIME=(2)                                         
//*                                                         
//  JCLLIB ORDER=YSWA.DEV.JCLLIB                            
//*                                                         
//STEP2    EXEC IGYWCLG,MEM=TCOB1                           
//COBOL.SYSIN DD DSN=YSWA.DEV.TEST.SOURCE(&MEM),            
//             DISP=SHR                                     
//LKED.SYSLMOD DD DSN=YSWA.DEV.COB.LOADLIB(&MEM),           
//             DISP=SHR                                     
//*                                                         
Job to take unload of table - 

//YSWATEST JOB (GENERAL),'DB2 UNLOAD',                      
//         CLASS=A,                                         
//         MSGCLASS=Q,                                      
//         NOTIFY=&SYSUID,                                  
//         MSGLEVEL=(1,1),                                  
//         TIME=(0,1),                                      
//         PRTY=8                                           
//*                                                         
//STEP1    EXEC  PGM=IKJEFT01                               
//SYSTSPRT DD    SYSOUT=*                                   
//SYSPRINT DD    SYSOUT=*                                   
//SYSOUT    DD    SYSOUT=*                                   
//SYSIN      DD    *                                          
    SELECT *                                                
     FROM EMP_TABLE                                         
     WHERE EMP_NAME  = 'SANDIP'                                 
    WITH UR;                                                
//*                                                         
//SYSTSIN  DD    *                                          
   DSN SYSTEM(DBG2)                                         
   RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')        
//*  DATA FILE                                              
//SYSREC00 DD    DSN=YSWA.DEV.DATA1X,                       
//             DISP=(NEW,CATLG,DELETE),                     
//             UNIT=SYSDA,SPACE=(CYL,(1,1))                 
//*  CTRL FILE                                              
//SYSPUNCH DD    DSN=YSWA.DEV.CTRL1X,                       
//             DISP=(NEW,CATLG,DELETE),                     
//             UNIT=SYSDA,SPACE=(CYL,(1,1))                 
//*                                                         

Monday, 11 February 2013

CICS Commands to add program in PCT, PPT, RCT, FCT


Define entry in PPT for program TSTPRG grp TSTGRP


CEDA DEF PROG(TSTPRG) GROUP(TSTGRP)

CEDA INSTALL PROG(TSTPRG) GROUP(TSTGRP)




Define entry in PCT for program TSTPRG grp TSTGRP and transaction TRN1

CEDA DEF TRANS(TRN1) PROG(TSTPRG) GROUP(TSTGRP)  

CEDA INSTALL TRANS(TRN1) PROG(TSTPRG) GROUP(TSTGRP)



Command to reflect new changes made to program.

CEMT SET PROG(TSTPRG) NEWCOPY





Command to add entry of MAPSET in PPT

CEDA DEF MAPSET(TSTMAP) GROUP(TSTGRP)

CEDA INSTALL MAPSET(TSTMAP) GROUP(TSTGRP)

CECI SEND MAP(TSTINFO) MAPSET(TSTMAP) 





Define file name in FCT Filename - TSTFILE DSNAME - NA7384A.CICS.INPUT

CEDA DEF FILE(TSTFILE) GROUP(TSTGRP) DSNAME(NA7384A.CICS.INPUT)




Command to open file 
CEMT SET FILE(TSTFILE) OPEN ENA

ENA - Enabled 


Command to close file 

CEMT SET FILE(TSTFILE) CLOSE DIS

DIS - Disabled




Define CICS-DB2 program 

CEDA DEF DB2ENTRY(TRN1) TRANS(TRN1) PLAN(TSTPLAN) GROUP(TSTGRP)

CEDA INSTALL DB2ENTRY(TRN1) TRANS(TRN1) PLAN(TSTPLAN) GROUP(TSTGRP)



Sunday, 10 February 2013

FIND Command in Dataset


FIND Command :

1) F ALL P'¬'   -- Gives count of non-space characters
2) F ALL P'='   -- find outs any chacter
3) F ALL
P'@'  -- Alphabetic characters
4) F ALL P'-'   -- Non-numeric characters
5) F ALL P'#'   -- Numeric characters

=  any character
.   non-displayable characters
@ alphabetic characters
-  non-numeric characters
# numeric characters
< lower case alphabetics
$  special characters
> upper case alphabetics
¬ non-blank characters

Saturday, 9 February 2013

Easytrieve to copy data from file

Easytrieve to copy data from file :

//STEP020     EXEC  PGM=EZTPA00                         
//EZTVFM    DD    SPACE=(CYL,(3,3)),UNIT=SYSDA        
//SYSPRINT DD    SYSOUT=*                            
//SYSOUT    DD    SYSOUT=*                            
//INFILE       DD    *                                   
21400 SANDIP 55555                                   
//OUTFILE  DD    DSN=NA7384A.TEST.OUT1,DISP=OLD      
//SYSIN    DD    *
                                   
*                                                    
  FILE INFILE                                        
    INREC           01   80  A                       
      EID              01   05  A                       
      ENAME      07   06  A                       
      ESAL          14   05  N                       
*                                                    
  FILE OUTFILE                                       
    OUTREC       01   80  A                       
      EIDO           01   05  A                       
      ENAMEO   07   06  A                       
      ESALO       14   05  N                       
*                                                    
  JOB INPUT NULL                                     
*                                                    
  GET INFILE                                         
*                                                    
    IF EOF INFILE                                    
       DISPLAY ' END HAS REACHED '                   
    STOP                                             
    END-IF                                           
       EIDO           = EID                                
       ENAMEO   = ENAME                              
       ESALO       = ESAL + 3333                       
       PUT OUTFILE                                   

Friday, 8 February 2013

Easytrieve to fetch data from table


Easytrieve to fetch data from table :

/*ROUTE XEQ DB2D                                       
//*                                                    
//STEP010  EXEC  UCC11RMS,TYPRUN='F'                   
//*                                                    
//STEP020  EXEC  PGM=EZTPA00                           
//EZTVFM   DD    SPACE=(CYL,(3,3)),UNIT=SYSDA          
//SYSPRINT DD    SYSOUT=*                              
//SYSOUT   DD    SYSOUT=*                              
//INFILE    
DD                                        
111111111111                                           
222222222222                                           
//OUTFILE  DD    DSN=XX7384A.TEST.OUT1,DISP=OLD        
//SYSIN      DD    *                                     
*                                                      
    PARM SSID(DB2D)    -                               
    SQLSYNTAX(FULL)                                    
*                                                      
  FILE INFILE                                          
     CM-N1    01  12  A                               
*                                                      
  FILE OUTFILE                                         
     CM-N2    01  12  A                               
     R-PRG    14  06  A                               
     S-CD       22  01  A                               
*                                                      
     WS-CM-N    W   12   A                              
     WS-RB-CD  W   06   A                              
     WS-ST-CD  W   01   A                              
*                                                      
   SQL DECLARE CUR1 CURSOR FOR       +                 
       SELECT CM_N,                                +                 
                  PG_CD,                                   +                 
                  ST_CD                                     +                 
       FROM GRABC.XXXYY_ZZ_ABCD     +                 
       WHERE CM_N = : WS-CM-N           +                 
       WITH UR                                         
*                       
   JOB INPUT INFILE                                   
*                                                     
    WS-CM-N  =  CM-N1                               
*                                                     
   SQL OPEN CUR1                                      
*                                                     
   DO UNTIL SQLCODE NE 0                              
     SQL FETCH CUR1           +                           
     INTO : WS-CM-N,          +                        
               : WS-RB-CD,         +                           
               : WS-ST-CD                                  
*                                                     
     IF SQLCODE = 0                                   
         CM-N2  =  WS-CM-N                          
         R-PRG   =  WS-RB-CD                          
         S-CD     =  WS-ST-CD                          
         PUT OUTFILE                                  
     ELSE                                             
        IF SQLCODE = 100                              
          DISPLAY ' ROW NOT FOUND '                   
        ELSE                                          
          DISPLAY ' OTHER ERROR ' SQLCODE             
        END-IF                                        
     END-IF                                           
   END-DO                                             
*                                                     
   SQL CLOSE CUR1                                     
*

Thursday, 7 February 2013

Compare two files using Easytrieve


Compare two files using Easytrieve -

//STEP020    EXEC  PGM=EZTPA00                                     
//EZTVFM    DD    SPACE=(CYL,(3,3)),UNIT=SYSDA                    
//SYSPRINT DD    SYSOUT=*                                        
//SYSOUT    DD    SYSOUT=*                                        
//INFILE1     DD    *
                                               
21400 SANDIP 11111                                               
21500 MANDIP 22222                                               
21600 RANDIP 33333                                               
21700 BALDIP 44444
                                               
//INFILE2   DD    *                                               
21500 PUNE                                                       
21600 MUMBAI                                                     
21800 CHENAI                                                     
21900 HYDERABAD
                                                  
//OUTFILE  DD    DSN=XX7384A.TEST.OUT1,DISP=OLD                  
//SYSIN       DD    *                                               
*                                                                
  FILE INFILE1                                                   
    EID1             01  05  A                                         
    ENAME1     07  06  A                                         
    ESAL1         14  05  N                                         
*                                                                
  FILE INFILE2                                                   
    EID2            01  05  A                                         
    ECITY2       07  10  A                                         
*                                                                
  FILE OUTFILE                                                   
    EIDO           01  05  A                                         
    ENAMEO    07  06  A                                         
    ESALO        15  05  N                                         
    ECITYO       22  10  A                                         
*                                                                
    WS-COUNT   W   04  N                                         
*                                                                
  JOB INPUT (INFILE1 KEY(EID1)    +                              
                        INFILE2 KEY(EID2))   +                              
            NAME PLAMATCH FINISH DISP-RTN                        
  IF MATCHED                                
         EIDO          = EID1                      
         ENAMEO  = ENAME1                    
         ESALO      = ESAL1                     
         ECITYO    = ECITY2                    
         PUT OUTFILE                        
         WS-COUNT = WS-COUNT + 1            
  END-IF                                    
  DISP-RTN. PROC.                           
     DISPLAY ' RECORDS MATCHED ' WS-COUNT   
  END-PROC.
      

Output :
21500 MANDIP  22222  PUNE    
21600 RANDIP  33333  MUMBAI