Now the file xxx.yyy.zzz contains an information in its header record, say a sequence number. This sequence number will vary on daily basis. The sequence number is to be extracted from the INDSN file and is to be plugged in the name of the OUTDSN file name ie. aaa.bbb.ccc.seqno before we do the NDM.
We can extract the sequence number from the input file but how can we pass the same to the output filename before doing the NDM. This needs to be done in the same job by adding steps prior to the NDM.
It will be great if someone can provide the complete steps for this.
I'm not sure I'm following what you are asking for. You say that you already can extract the sequence number from the input file. Can't the same process create the required control record:
Code:
&OUTDSN=aaa.bbb.ccc.seqno -
into a temporary dataset and pass that dataset as one of the inputs to the DMBATCH step?
NDMJOB PROCESS -
HOLD=NO -
PNODE=REG1 -
SNODE=REG2 -
PRTY=15
COPYDSN1 COPY FROM (PNODE DSN=&INDSN DISP=SHR) -
TO (SNODE DSN=&OUTDSN DISP=(NEW,CATLG)) -
COMPRESS EXTENDED
Now, I need to plug in the sequence number (which is present in the INDSN file) with the name of the OUTDSN file.
Yup, I can create a control card which will have the sequence number plugged into the OUTDSN filename. This control card will be created in a separate program which is also going to create the INDSN file. The control card will look as follows:
Control card (OFILNAM)
AAAA.BBBB.CCCC.seqno -
say, the control is present in Library FFFF.GGGG.DDDD(OFILNAM)
How do I use this control card containing the OUTDSN file name in my NDM Job mentioned at the top to pass the OUTDSN file name?
The problem is as to how to create the control card.
&OUTDSN=aaa.bbb.ccc.seqno -
The program which creates the input file can only create an additional flat file which will have one record containing the statement required in the control card.
How do I create the control card from this flat file?
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Thu Aug 18, 2005 8:07 am Post subject:
Heman,
You can use SORT to create the dynamic control card which reads just the first record from your input file and creates the dynamic file name along with the seqno.
Assuming that your seqno in the input file starts at pos 1 for 5 bytes the following JCL will build the dynamic output file name appending the seqno at the end.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
12345
REC1
REC2
REC3
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION STOPAFT=1
SORT FIELDS=COPY
OUTFIL OUTREC=(C' SIGNON',/,
C' SUBMIT PROC=NDMRNJOB -',/,
C' PNODE=REGION1 -',/,
C' SNODE=REGION2 -',/,
C' &PROCESS=TESTNDM -',/,
C' NEWNAME=&PROCESS -',/,
C' &INDSN=XXX.YYY.ZZZ -',/,
C' &OUTDSN=AAA.BBB.CCC.',
1,5,
C' -',/,
C' &OUTDISP=(NEW,CATLG,DELETE)',/,
C' SIGNOFF',80:X)
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum