JCL SYSIN Statement

JCL SYSUDUMP JCL REFERBACK

Advertisements


SYSIN statement used to start an instream data set.

SYSIN card is used to send vast input data to the program using the JCL.

Data can be accepted in the program through ACCEPT statement.

One row in the SYSIN will be equal to one ACCEPT in the program.

/* known as delimiter and by using /* we can end the instream data.

Delimiter (/*) is mandatory with SYSIN.

Delimiter (/*) always starts at column1 and ends at column2.

If both PARM & SYSIN DD* in one JCL, the first preference is for PARM parameter and after SYSIN DD*.

In-stream data sets begin with a DD * or DD DATA statement.


Syntax:

//SYSIN DD parameter[,parameter]...  [comments]

The first parameter is an * or DATA to specify that an in-stream data set follows immediately.

Do not code a symbolic in place of the * or DATA positional parameter on a SYSIN type DD statement.

Below example shows show the SYSIN data accepted in the program.



JCL:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 //MTHUSERJ JOB (META007),'PAWAN Y',CLASS=A,MSGCLASS=L,MSGLEVEL=(1,1),   
000002 //             TIME=1440,NOTIFY=&SYSUID                                 
000003 //*                                                                     
000004 //JOBLIB   DD  DSN=MTHUSER.MY.LOADLIB,DISP=SHR                          
000005 //*                                                                     
000006 //STEP01   EXEC PGM=DATECONV                                            
000007 //STEPLIB  DD  DSN=MTHUSER.TEST.LOADLIB,DISP=SHR                        
000008 //SYSIN    DD  *
000008 20160101
000008 /*
000009 //OUTFILE  DD  DSN=MTHUSER.EXAMPROG.OUTPUT,                             
000010 //             DISP=(NEW,CATLG,DELETE),                                 
000011 //             UNIT=(SYSDA,20),                                         
000012 //             SPACE=(CYL,(50,25)),                                     
000013 //             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,BUFNO=2)                
000014 //*                                                                     
000015 //SYSPRINT DD SYSOUT=*                                                  
000016 //SYSUDUMP DD SYSOUT=*                                                  
000017 //SYSOUT   DD SYSOUT=*                                                  
****** **************************** Bottom of Data ****************************

Program:

IDENTIFICATION DIVISION.                                  
PROGRAM-ID. DATECONV.                                     
ENVIRONMENT DIVISION.                                     
DATA DIVISION.                                            
WORKING-STORAGE SECTION.                                  
                                                          
01 WS-DT-INP                PIC 9(08).     
01 WS-DT-OP1                PIC 9(07).                    
01 WS-DT-OP2                PIC 9(08).                    
                                                          
PROCEDURE DIVISION.                                      
0000-MAINLINE     SECTION.                                
                                                          
    ACCEPT  WS-DT-INP.                             
                                                          
    COMPUTE WS-DT-OP1 = FUNCTION DAY-OF-INTEGER (FUNCTION 
                INTEGER-OF-DATE (WS-DT-INP) - 1)          
                                                             
    COMPUTE WS-DT-OP2 = FUNCTION DATE-OF-INTEGER (FUNCTION  
                 INTEGER-OF-DATE (WS-DT-INP) - 1)            
                                                             
    DISPLAY 'DATE OUTPUT1      : ' WS-DT-OP1.               
                                                             
    DISPLAY 'DATE OUTPUT2      : ' WS-DT-OP2.               
                                                             
    STOP RUN.                  

JCL SYSUDUMP JCL REFERBACK

Advertisements