which is the better way to pass the values to the PGM?is it through PARM parameter or Instream Procedure.anyone ans pls.....
Printable View
which is the better way to pass the values to the PGM?is it through PARM parameter or Instream Procedure.anyone ans pls.....
Hi resh,
seems you are having trouble with mainframes man!!!
Anyway coming to your question,the only way you can pass values to your program via jcls is through the parm option used in instream proceedures (or optionally as a instream proceedure written in a different dataset called a sinlib).
For e.g in your JCL suppose the name of the program you are executing is resh and you want to pass the string "123" then:
//EXEC PGM=RESH,PARM="123"
And then in your linkage section of your program you have to declare the following variables in a similar format:
01 z-parm.
03 z-length pic s9(04).
03 z-value pic x(3).
Declare proceedure division as :
Procedure Division using z-parm.
Your parm will be recieved in the variable z-value.
p.s:if this doesnt work do let me know.:-)
Whether you use parm or DD data is a factor of data size and reuse.
Small variables not accessed anywhere else can be put in a parm.
If you have to process a lot of data or the info has to be used elsewhere, use a DD.
An example of this is a Datecard. While datecards are usually 1 line with 80 characters, many programs will need to know which days data they are processing.
By the way instream procedures are in no way related to this.
You can pass data to prgm using two methods 1. parm 2. control card (sysin)
using parm u can pass up to 100 characters only. for large data use sysin