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
 

 

Use the same file name in STEP for copying records from File

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

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 1:35 pm    Post subject: Use the same file name in STEP for copying records from File
Reply with quote

Please find my requirement as follows:
1. A file name(File01) will be written to a Dataset(PS file FileA) in STEP01 of the job. This File name has a sequence number (as a part of its qualifier) which is generated dynamically.
2. In STEP02 of the job we need to copy the records from a different file say File02 to File01.

a. How to read the file name from the PS file FileA (which is created in STEP01)
b.How to use the same file name in STEP02 for copying records from File02?
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue May 26, 2009 2:04 pm    Post subject:
Reply with quote

It's quite unclear what you are asking.

Quote:
This File name has a sequence number (as a part of its qualifier) which is generated dynamically.
By "file name" are you referring to the contents of "PS file FileA" or to . . . icon_confused.gif
Quote:
How to read the file name from the PS file FileA using a jcl
As have been stated many times earlier-- JCL itself will do nothing, you need to direct some program or utility to do that.
Quote:
How to use the same file name in STEP02 for copying records from File02?
Just provide the correct DSN in step02... icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 26, 2009 2:07 pm    Post subject:
Reply with quote

How is the dataset created in STEP01, dynamically by the program or via the JCL statements
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 2:22 pm    Post subject:
Reply with quote

Explanation of the requirement:

1. Content of a dataset F0123QGH.TSBXXXX.DSN01(MEM01) is
F0123QGH.TSBXXXX.SEQ001 (in STEP01). When the job runs next time the "SEQ001" would be changed to "SEQ002" and so on.
2. In STEP02, we need to copy the records from an Input file F0123QGH.TSBXXXX.FILEA to the F0123QGH.TSBXXXX.SEQ001.

Here my question is, how to get the sequence file name (in STEP01) and use it in STEP02?

Please let me know if I'm still unclear.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 2:56 pm    Post subject:
Reply with quote

There is a program which updates the File F0123QGH.TSBXXXX.DSN01(MEM01) with the sequence file name F0123QGH.TSBXXXX.SEQ00*.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 26, 2009 3:18 pm    Post subject:
Reply with quote

As previously requested, how is the dataset created in STEP01

Is it via JCL statements or dynamically by the program.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 3:19 pm    Post subject:
Reply with quote

There is a program which updates the File F0123QGH.TSBXXXX.DSN01(MEM01) with the sequence file name F0123QGH.TSBXXXX.SEQ00*.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 26, 2009 3:48 pm    Post subject:
Reply with quote

itjagadesh wrote:
There is a program which updates the File F0123QGH.TSBXXXX.DSN01(MEM01) with the sequence file name F0123QGH.TSBXXXX.SEQ00*.

Yes, I did happen to understand that icon_rolleyes.gif

Now, you say that STEP01 creates the dataset which is given in the PDS member. Please explain to me in great detail what happens. Does the program executed in STEP01 read the PDS member and dynamically create the dataset named in the PDS, or does the dataset mentioned in the PDS appear in a JCL DD statement to create the dataset.

The best solution would be that the PDS member is created as
Code:
// SET     DSNAME=dataset.name

and then it could be included into the JCL - see example below
Code:

//         JCLLIB ORDER=(PDS name)
//*
//DSNAME   INCLUDE MEMBER=Member name
//*
//STEP01   EXEC PGM=whatever
//DDNAME   DD DSN=&DSNAME,DISP=....
//*
//STEP02   EXEC PGM=whatever
//DDNAME   DD DSN=&DSNAME,DISP=....
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 4:02 pm    Post subject:
Reply with quote

Hi,

Please see in the below step the SEQP is the DDname of the Sequence file to the PGM01
//STEP01 EXEC PGM=PGM01
//SEQP DD DSN=F012QGH.MOSDAILY.SEQUENCE,DISP=SHR,
// AMP='BUFND=30,BUFNI=15'
//SYSPRINT DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SYSUDUMP DD SYSOUT=A

The Sequence file F012QGH.MOSDAILY.SEQUENCE will have a file name in turn, which we should read and use it in the next step to copy the records from the file say, File01 of STEP02 to the file name say File02 in F012QGH.MOSDAILY.SEQUENCE.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 26, 2009 4:56 pm    Post subject:
Reply with quote

Just a suggestion, but, why not use a GDG and have done with all of this farting about.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 5:36 pm    Post subject:
Reply with quote

Actually as per our current requirement we just need to include the repro step alone. So I don't know how to go about it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 26, 2009 7:26 pm    Post subject:
Reply with quote

The REPRO JCL is pretty simple using a GDG as output
Code:

//STEPnnnn EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OUTFILE  DD DSN=GDG.base.name(+1),DISP=.......
//SYSIN    DD *
 REPRO IDS(input dataset name) OFILE(OUTFILE)
/*
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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