Hi All,
How to pass the data to Natural program through JCL.
Hi All,
How to pass the data to Natural program through JCL.
education, education, education !!!
also, you might try asking your dba.
steve
Presuming that you’re using IBM JCL, passing a couple of values would look something like this:
//CMSYNIN DD *
LOGON library
pgmname value1,value2
/*
For more than a few values, you can start on a separate line:
//CMSYNIN DD *
LOGON library
pgmname
value1,value2,value3,value4,value5,value6
/*
The values are separated by the delimiter character, and follow the order of the variables on the corresponding INPUT statement in your program (left to right, top to bottom). If executing in Forms Mode, each line of values on the map is represented as a separate line of input data in the JCL. If executing in Delimiter Mode, all values are placed on a single line in the JCL. If the “single line” is longer than 72 characters, it can be continued onto more physical lines by using the continuation character.
//CMSYNIN DD *
LOGON library
pgmname
value1,value2,value3,%
value4,value5,value6
You can add multiple cards after the //SYSIN DD *
and in the program use the INPUT statement.
in the jcl following the
//SYSIN DD *
PROGRAMNAME
programnCC
TERMINATE = 20
WORK FILE = WORK.FILE.NAME
EXE FILE = executiblename
DISPLAYLOG= N
END DATA
/*
in structured mode DEFINE DATA
1 #CONTROL-CARD (A72)
1 REDEFINE #CONTROL-CARD
2 #CC-PROGRAM(A8)
2 #CC-CC (A2)
2 #CC-FILL1 (A1)
1 #VALID-KEY-WORDS (A250)
1 REDEFINE #VALID-KEY-WORDS
2 #VALID-KEY-WORD(A10/1:#KMAX)
*
END-DEFINE
------------------------------------------------------------ *
LIST ALL CONTROL CARD KEY_WORDS HERE
------------------------------------------------------------ *
MOVE ‘END DATA’ TO #VALID-KEY-WORD(01)
MOVE ‘WORK FILE’ TO #VALID-KEY-WORD(02) /* REQUIRED
MOVE ‘EXE FILE’ TO #VALID-KEY-WORD(03)
MOVE ‘TERMINATE’ TO #VALID-KEY-WORD(04) /* OPT FAIL TERMINATE VALUE
MOVE ‘DISPLAYLOG’ TO #VALID-KEY-WORD(05)
------------------------------------------------------------ *
PARSE THE CONTROL CARDS
------------------------------------------------------------ *
FOR #C EQ 1 TO #CMAX
INPUT #CONTROL-CARD
IF #C EQ 1
IF *PROGRAM NE #CC-PROGRAM
WRITE ‘INCORRECT CONTROL CARD’ / #CONTROL-CARD
COMPUTE #BLOW-UP = #BLOW-UP / 0
END-IF
ESCAPE TOP
END-IF
*
RESET #CC-KEY-WORD #CC-VALUE #CC-REMAINDER
SEPARATE #CONTROL-CARD INTO #CC-KEY-WORD #CC-VALUE
REMAINDER #CC-REMAINDER WITH DELIMITER #CC-DELIMITER
MOVE LEFT #CC-KEY-WORD TO #CC-KEY-WORD
MOVE LEFT #CC-VALUE TO #CC-VALUE
*
…
END-FOR