View previous topic :: View next topic
|
Author |
Message |
cima
New User
Joined: 22 Mar 2006 Posts: 8
|
|
|
|
Hi all,
I would like to know if and how we can write records to a dataset using just JCL.
Scenario:
Lets say, these 3 Files were sent via FTPS in the previous steps:
FILE1_%%$ODATE.%%TIME
FILE2_%%$ODATE.%%TIME
FILE3_%%$ODATE.%%TIME
Requirement:
Once all 3 files are transferred, we have to send them a so-called "flagfile". This flagfile must contain the 3 filenames, so that the downstream application knows, what filenames we sent to them, since %%$ODATE and %%TIME are Control-M Variables and can change after each run.
The JCL would look like this:
//* Send FILE1_%%$ODATE.%%TIME
//STEP1 EXEC PGM=FTPSPROC
....
//* Send FILE3_%%$ODATE.%%TIME
//STEP2 EXEC PGM=FTPSPROC
....
//* Send FILE3_%%$ODATE.%%TIME
//STEP3 EXEC PGM=FTPSPROC
....
//* Generate Flagfile FLAG_FILE
//STEP4 EXEC PGM=???
??????
//* Send FLAG_FILE
//STEP5 EXEC PGM=FTPSPROC
??????
I would like to avoid to write a very simple program for this.
Hopefully I am clear enough with the requirement.
Many thanks in advance.
Regards,
cima |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Quote: |
I would like to avoid to write a very simple program for this. |
Cant you handle these through return codes? |
|
Back to top |
|
|
cima
New User
Joined: 22 Mar 2006 Posts: 8
|
|
|
|
Quote: |
Cant you handle these through return codes?
|
I'm not sure, how I can create the flag file with returncodes. But of course, each step does have a returncode handling. I just didnt write it..
So its like the ff:
//* Send FILE1_%%$ODATE.%%TIME
//STEP1 EXEC PGM=FTPSPROC
....
//* Send FILE3_%%$ODATE.%%TIME
// IF RC = 0 THEN
//STEP2 EXEC PGM=FTPSPROC
....
// ENDIF
//* Send FILE3_%%$ODATE.%%TIME
// IF RC = 0 THEN
//STEP3 EXEC PGM=FTPSPROC
....
// ENDIF
//* Generate Flagfile FLAG_FILE
// IF RC = 0 THEN
//STEP4 EXEC PGM=???
??????
// ENDIF
//* Send FLAG_FILE
// IF RC = 0 THEN
//STEP5 EXEC PGM=FTPSPROC
...
// ENDIF |
|
Back to top |
|
|
hailashwin
New User
Joined: 16 Oct 2008 Posts: 74 Location: Boston
|
|
|
|
Considering that STEP1,STEP2 and STEP3 gets the filenames to be transmitted after the substitution of %%$ODATE and %%TIME just before submission, would it be possible that the STEP4 has instream data just like the example below that could also be substituted? This would get you the file names in the SORTOUT?
Code: |
//*
//STEP4 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
FILE1_%%$ODATE.%%TIME
FILE2_%%$ODATE.%%TIME
FILE3_%%$ODATE.%%TIME
//SORTOUT DD DSN=XXXXX.XXXXXX,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(100,100),RLSE),
// RECFM=FB,LRECL=80
//SYSIN DD *
OPTION COPY
//*
|
Thanks,
Ashwin. |
|
Back to top |
|
|
cima
New User
Joined: 22 Mar 2006 Posts: 8
|
|
|
|
Hi Ashwin,
That's it.. You're example worked..
Many thanks..
Regards,
cima |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
100 cylinders for 3 80 byte records? You must be joking. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Nic might be due to copy paste issue |
|
Back to top |
|
|
hailashwin
New User
Joined: 16 Oct 2008 Posts: 74 Location: Boston
|
|
|
|
Quote: |
That's it.. You're example worked..
|
Good to hear
Quote: |
100 cylinders for 3 80 byte records? You must be joking.
|
It was an example which I picked from an old template I had. Thanks Nic for pointing that out
Thanks,
Ashwin. |
|
Back to top |
|
|
hailashwin
New User
Joined: 16 Oct 2008 Posts: 74 Location: Boston
|
|
|
|
Quote: |
Nic might be due to copy paste issue
|
Bingo! |
|
Back to top |
|
|
|