Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Write records to dataset using JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
cima

New User


Joined: 22 Mar 2006
Posts: 8

PostPosted: Wed Nov 20, 2013 12:14 pm    Post subject: Write records to dataset using JCL
Reply with quote

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
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Nov 20, 2013 12:25 pm    Post subject:
Reply with quote

Quote:
I would like to avoid to write a very simple program for this.


Cant you handle these through return codes?
Back to top
View user's profile Send private message
cima

New User


Joined: 22 Mar 2006
Posts: 8

PostPosted: Wed Nov 20, 2013 12:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Wed Nov 20, 2013 1:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
cima

New User


Joined: 22 Mar 2006
Posts: 8

PostPosted: Wed Nov 20, 2013 1:58 pm    Post subject: Reply to: Write records to dataset using JCL
Reply with quote

Hi Ashwin,

That's it.. You're example worked..

Many thanks.. icon_biggrin.gif

Regards,
cima
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Wed Nov 20, 2013 2:56 pm    Post subject:
Reply with quote

100 cylinders for 3 80 byte records? You must be joking.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Nov 20, 2013 3:05 pm    Post subject:
Reply with quote

Nic might be due to copy paste issue icon_smile.gif
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Wed Nov 20, 2013 3:06 pm    Post subject:
Reply with quote

Quote:

That's it.. You're example worked..


Good to hear icon_smile.gif


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 icon_smile.gif

Thanks,
Ashwin.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Wed Nov 20, 2013 3:14 pm    Post subject:
Reply with quote

Quote:

Nic might be due to copy paste issue


Bingo! icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us