View previous topic :: View next topic
|
Author |
Message |
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
Hi,
I have an input file like below.
Code: |
*******************
MJR1.V7117.S011SQFT
MJR1.V7117.S012SQFT
MJR1.V7117.S013SQFT
MJR1.V7117.S014SQFT
MJR1.V7117.S015SQFT
MJR1.V7117.S016SQFT
MJR1.V7117.S017SQFT
|
MJR1.V7117.S011SQFT, MJR1.V7117.S012SQFT etc are file names. There can be any no of file names.
What i need is to read the input file which has above file names and copy the contents of those files one after the other into an output file.
For example, copy the contents of 1st file MJR1.V7117.S011SQFT into an output file. then append the contents of 2nd file MJR1.V7117.S012SQFT into the same output file etc .
I know how to do this using REXX. But my client doesn't want this to do using REXX. Any help would be appreciated greatly. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Why not write a REXX routine that builds JCL from your list of file names and submits it? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you could build repro parms with sort and then feed those to a job. |
|
Back to top |
|
|
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
Hi Dick,
can you please explain more about it? Thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
use sort to generate repro parms.
the output of the sort would be the sysin to the next step which would invoke a utility (idcams?, IEBGENER?) which would perform the copies.
no rexx, no substitution of JCL: one job two steps. |
|
Back to top |
|
|
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
I can create the 2nd step as you told. But how to generate repo parms? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
But how to generate repo parms?
|
I thought that was why your thread was in the DFSORT forum.
in detail,
describe your input file,
describe your output file - what are your expected parms.
Kolusu or Frank, who have answered this question several times, will help
you with the generation of the SORT Step(s).
May require two steps,
one to generate symbolics for the second,
and the second to generate the parms -
there is a lot of literal data that needs go added along with the file names. |
|
Back to top |
|
|
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
Input file is LRECL 120 with format FB and Output file is the same (LRECL 120 and format FB)
The contents of each file (whose file names are present in input file) has same LRECL 120 and format FB.
In short, all the files used is LRECL 120 and format FB. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the length of the output file will be 80 - standard for most utility sysins.
within the 120 byte input file, do the dsn's start in col 1?
and have you decided what utility to use to actually perform the copy?
when you have, describe the parms necessary for the utility. |
|
Back to top |
|
|
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
Sorry dick. the length of all the files used is 80. The copy utility used will be IEBGENER or another SORT. I need to know how to generate Repo parms as i haven't worked on that yet.
I searched in this forum for similar kind of requirement. But couln't.
Please help. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sathish,
relax.
nice thing about DFSORT is that the team that maintains the product for IBM
are members of this Website & moderator of this forum.
as a result, if you detail your requirements,
they will provide you the necessary control cards
and go to the trouble of explaining.
but, as with anything, good service requires adequately defined expectations
no one can read your mind, so explain in detail what you need generated
so that all you have to do is use the output of the sort as a sysin input to
your iebgener step.
so, describe in detail the iebgener parms that you want as output of the sort based on your input file.
are there any hfs (UNIX) files involved? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This might help if the length of the file names are all the same. I for one would certainly be interested in seeing a solution for variable length filenames. This is just a little something that I saw on this forum and kept for future reference.
Input was
Code: |
//SORTIN DD *
EFGH
PQRS
XYZU |
Output was
Code: |
REPRO IDS('EFGH') OFILE=(OUTDD)
REPRO IDS('PQRS') OFILE=(OUTDD)
REPRO IDS('XYZU') OFILE=(OUTDD) |
Statements used were
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL BUILD=(C' REPRO IDS(''',1,4,C''') OFILE=(OUTDD)',80:X) |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
Back to top |
|
|
Sathish Gurumoorthy
New User
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
|
|
|
|
The below jcl works perfect.
Code: |
//STEP010 EXEC PGM=SORT
//*
//SORTIN DD *
TMS047.COBCHK.PO535120.OUTPUT
TMS047.COBCHK.PO535140.OUTPUT
TMS047.COBCHK.PO535200.OUTPUT
TMS047.COBCHK.PO535350.OUTPUT
TMS047.COBCHK.P0535380.OUTPUT
//*
//SORTOUT DD DSN=TMS047.REPOPARM.FILE1,
// UNIT=DASD,SPACE=(CYL,(5,10),RLSE),
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80)
//*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL BUILD=(C' REPRO IDS(''',1,29,C''') OUTFILE(OUTDD)',80:X)
//SORTWK01 DD UNIT=DASD,SPACE=(CYL,(100,50))
//SORTWK02 DD UNIT=DASD,SPACE=(CYL,(100,50))
//*
//*
//STEP02 EXEC PGM=IDCAMS,DYNAMNBR=30
//SYSPRINT DD SYSOUT=*
//OUTDD DD DSN=TMS047.REPOPARM.FILE2,
// UNIT=DASD,SPACE=(CYL,(5,10),RLSE),
// DISP=(MOD,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80)
//SYSIN DD DSN=TMS047.REPOPARM.FILE1,DISP=SHR
|
Thank you very much Expat and Dick for ur suggesstions. I got one more way to solve this. Thank you Skolusu |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Sathish,
glad that you were able to help yourself. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL BUILD=(C' REPRO IDS(''',1,29,C''') OUTFILE(OUTDD)',80:X)
//SORTWK01 DD UNIT=DASD,SPACE=(CYL,(100,50))
//SORTWK02 DD UNIT=DASD,SPACE=(CYL,(100,50))
|
You should remove the SORTWK01 and SORTWK02 DD statements. Work data sets are not used for a COPY application, so you are just wasting space by specifying these DDs. In fact, it's better not to specify SORTWKnn DDs even for a SORT application - let DFSORT allocate the needed work data sets dynamically. |
|
Back to top |
|
|
|