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

how to copy data from 2 or more flat files in to one


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahil_maqsood

New User


Joined: 28 Mar 2005
Posts: 6

PostPosted: Wed Jun 01, 2005 2:07 pm
Reply with quote

Hi Everyone,

Can anybody tell me how to copy data from 2 or more flat files in to another flat file using utility not by concatenating using DD statement.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jun 01, 2005 2:24 pm
Reply with quote

Why don't you want to use a concatenated list?
It's for the reason that the logical record lenght or the format of record is different?

Which is the original problem?
Back to top
View user's profile Send private message
jkbytes

Active User


Joined: 19 Feb 2005
Posts: 139
Location: South Africa

PostPosted: Wed Jun 01, 2005 4:43 pm
Reply with quote

Code:
000200 //STEP1 EXEC PGM=IEBCOPY                                   
 000300 //SYSPRINT DD SYSOUT=*                                     
 000400 //IN DD DSN=MTPLB21.JCL.CNTL,DISP=SHR                     
 000500 //OUT DD DSN=MTPLB21.JCL.ANJ,DISP=SHR                     
 000800 //SYSIN DD *                                               
 000900       COPY OUTDD=OUT,INDD=IN                               
 001000       SELECT MEMBER=(SEC1,SEC2,SEC3)                       
 001100 /*                                                         


i guess this utility will do the job
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jun 01, 2005 5:58 pm
Reply with quote

Whenever I want to copy one-to-one, one-to-many, many-to-many, or many-to-one, I use ICETOOL:
Code:

//COPY    EXEC PGM=ICETOOL                             
//DFSMSG   DD   SYSOUT=*                                 
//TOOLMSG  DD   SYSOUT=*                                 
//IN1      DD   DISP=SHR,DSN=DSN1                               
//IN2      DD   DISP=SHR,DSN=DSN2
...
//INX      DD   DISP=SHR,DSN=DSNX
//OUT      DD   DSN=DSNOUT,                   
//         DISP=(MOD,CATLG,DELETE),UNIT=SYSDA,             
//         SPACE=(CYL,(10,10),RLSE)                     
//TOOLIN   DD   *                                       
  COPY FROM(IN1) TO(OUT)                                   
  COPY FROM(IN2) TO(OUT)
  ...
  COPY FROM(INX) TO(OUT)
/*
//*
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jun 01, 2005 7:06 pm
Reply with quote

I think that are several method to do the same thing(IEBCOPY is useful only for partitioned whereas ICETOOL or IDCAMS work fine for both PS,PO) but there is only one reason that exclude the concatenation of files -I hope!
Back to top
View user's profile Send private message
nirav

New User


Joined: 14 Feb 2005
Posts: 3

PostPosted: Sun Jun 05, 2005 8:19 am
Reply with quote

If you want to use utility then you can use Fileaid utility to copy any number of flat files (not more than 255) into one single file.

The sample is:
//STEP01 EXEC PGM=FILEAID
//*
//DD01 DD DISP=SHR,DSN=sample1.flatfile1
// DD DISP=SHR,DSN=sample2.flatfile2
//DD01O DD DSN=output.flatfile3,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB),
// SPACE=(TRK,(4,10),RLSE),
// UNIT=SYSDA

the only thing you need to take care is all the files must have same DCB parameters.

Does this give your answer, please let me know.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top