My requirement is to create each file each day not all three files(i.e.) When I run job on tuseday,it should create only XXXX.TEST.FILE1 leaving other 2 files empty.When I run the job on Wednesday,it should create only XXXX.TEST.FILE2 and on Thrusday,it should create only XXX.TEST.FILE3.
Using above jcl,I cannot acomplish the given requirement. Is there any way to achieve the same?.
FYI : I have to revised the above Jcl and I cannot go for separate JCL's.
You could write an EZT program or Cobol program to genrate the JCL along Control parameters for the day.
COB program would be writing the o/p JCL to Internal reader.There are plenty of posts for Internal reader usage in the forum,just Search them.
Use WS-CURRENT-DAY in creating the filename as well as include clause.
Check following post
http://www.mvsforums.com/helpboards/viewtopic.php?t=1089
Code:
ACCEPT WS-CURRENT-DAY FROM DAY-OF-WEEK
EVALUDATE WS-CURRENT-DAY
When '1'
INCLUDE=(01,04,CH,EQ,C'MON') ==> MOVE TO O/P FILE
OUTFIL FILES=01, ==> MOVE TO O/P FILE
//SORTOF01 DD DSN=XXXX.TEST.MON, ==> MOVE TO O/P FILE
WHEN '2'
INCLUDE=(01,04,CH,EQ,C'TUE') ==> MOVE TO O/P FILE
OUTFIL FILES=02, ==> MOVE TO O/P FILE
//SORTOF01 DD DSN=XXXX.TEST.TUE, ==> MOVE TO O/P FILE
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Feb 02, 2004 6:17 am Post subject:
Amjad,
I see that all your files are created based on the same criteria (1,4,ch,eq,AAAA). why not create just one file( with a generic name) and run the job only on tuesday, wednesday and thursday?
Btw sort products does not have any built-in functions to determine day of the week. You can use db2 to determine the date and in next step run a sort to determine which file needs to be created. We use the DAYOFWEEK function which returns an integer in the range of 1 to 7 that represents the day of the week where 1 is Sunday and 7 is Saturday.
A brief explanation of the job. The first step unloads a 1 record from db2 table with the week day number in binary format. since today is monday that number will be 2. now we take this 1 record file is input in step0200 and first convert the binary number into zoned decimal number.
Now we generate the dynamic control cards for writting out to the right file based on the day. since you wanted to create the files only on monday tuesday wednesday, we code a dummy file for the rest of the days. For doing that we use a change command to determine the file number. The output from this step would be as follows
Code:
SORT FIELDS=COPY
INCLUDE COND=(1,4,CH,EQ,C'AAAA')
OUTFIL FILES=01
Now we will use this a control card for the actual dataset creation step(step0300)
Thanks for your valuable suggestions. I can neither go for DB2 nor eztrieve but to modify the JCL.We console the customer to send the input files so as to identify specific file to process on that specific day.
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