View previous topic :: View next topic
|
Author |
Message |
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 . . .
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... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
How is the dataset created in STEP01, dynamically by the program or via the JCL statements |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
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 |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
There is a program which updates the File F0123QGH.TSBXXXX.DSN01(MEM01) with the sequence file name F0123QGH.TSBXXXX.SEQ00*. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
As previously requested, how is the dataset created in STEP01
Is it via JCL statements or dynamically by the program. |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
There is a program which updates the File F0123QGH.TSBXXXX.DSN01(MEM01) with the sequence file name F0123QGH.TSBXXXX.SEQ00*. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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
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 |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Just a suggestion, but, why not use a GDG and have done with all of this farting about. |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
|