Page 1 of 1

How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 1:59 pm
by sudhir226
Hi,

I have an requirement. I have an input file and it will contain only once record. i have to assign that value to a symbolic parameter
Input Data: 713

i have to assign the value to my symbolic parameter
Required out put
SET DDD = 713

so anyone please help me how can i assign the value from an input file to set parameter

Re: How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 2:12 pm
by Robert Sample
Write a program in the language of your choice to read the file and create the JCL you want. The program -- or a utility (such as IEBGENER) n a separate step -- then writes the JCL to the internal reader, thereby submitting the job with your symbolic parameter.

Re: How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 4:36 pm
by sudhir226
Hi Robert,

Input File:
//SETVAR01 SET DDD='719'


I wrote once sort step that will increment the DDD value.

//STEP0010 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD DSN=TRANSMIT.XXX.AUTO.DDD,DISP=SHR 
//SORTOUT  DD DSN=TRANSMIT.XXX.AUTO.DDD,DISP=SHR 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  OUTREC IFTHEN=(WHEN=(21,3,ZD,EQ,999),                 
           OVERLAY=(21:C'700')),                         
         IFTHEN=(WHEN=(21,3,ZD,NE,0),                   
           OVERLAY=(21:+1,ADD,21,3,ZD,EDIT=(TTT)))       


After that by using the file.. i have to assign that value to a symbolic parameter.

//         SET HLQ2=NPDBCBS
//         SET HLQ=DN6VM0BN
//SETVAR01 SET DDD=[color=#FF4000]'713' [/color]


So i want to assign the value to the DDD parameter. Please advice me whether we can use the value from the file and can we assign to the ddd parameter

Re: How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 5:12 pm
by BillyBoyo
He's already done that.

Why call something DDD which can cause confusion with DDD as in the day-number a year?

Re: How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 6:22 pm
by sudhir226
Hi,

No Billy... The DDD is not the no.of the day.

//******************************************
//SETVAR01 SET DDD='715'                     
//******************************************
//STEP01   EXEC  PGM=IEBGENER               
//OUTDD1   OUTPUT DEST=XXX,                 
//SYSUT1   DD  DISP=SHR,DSN=XXXX.XXXXX.D&DDD
//SYSUT2   DD  SYSOUT=A,OUTPUT=(*.OUTDD1),


so the DDD value has to be incremented and if the valu reaches 999 again we have to intialize that value with 700. So i have to change the DDD value every day... So i am not sure how can i assign a value from the file and assign to this symbolic parameter value

Re: How to pass a value in a file to symbolic parameter

PostPosted: Wed Oct 17, 2012 6:45 pm
by BillyBoyo
I know it is not the number of the day. It has a number greater than 366 in it.

What I was saying is this: By using DDD you can cause confusion when someone looks at your JCL. They may think, quite naturally, that DDD SHOULD BE 366 or less! Why not call it DAYREF or DAYNO or something, you have some scope, so why pick out a dull DDD which is already in regular use for a different purpose.

Look at the JCL manual. Discover at what point the the JCL is "interpreted" into stuff that the system is going to use - at that same point, the JCL is effectively discarded. Now, suggest to us how you expect your scheme to work with that knowledge, other than by what Robert has already suggested, or by doing it under "TSO" in a language and then causing it to be SUBMITted.