IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

copy the contents of multiple files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 5:24 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 24, 2009 5:40 pm
Reply with quote

Why not write a REXX routine that builds JCL from your list of file names and submits it?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 5:40 pm
Reply with quote

you could build repro parms with sort and then feed those to a job.
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 5:43 pm
Reply with quote

Hi Dick,
can you please explain more about it? Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 5:49 pm
Reply with quote

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

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 5:53 pm
Reply with quote

I can create the 2nd step as you told. But how to generate repo parms?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 6:01 pm
Reply with quote

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

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 6:07 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 6:11 pm
Reply with quote

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

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Wed Jun 24, 2009 6:18 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 6:31 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 24, 2009 6:44 pm
Reply with quote

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jun 24, 2009 8:50 pm
Reply with quote

satish gurumurthy,

check this link which discusses the exact same question

ibmmainframes.com/viewtopic.php?p=124600#124600
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Thu Jun 25, 2009 5:16 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 25, 2009 5:21 pm
Reply with quote

Sathish,

glad that you were able to help yourself.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 25, 2009 9:29 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 5
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top