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
 

 

Merging files in a PS

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

New User


Joined: 03 Jan 2007
Posts: 15
Location: US

PostPosted: Wed Sep 23, 2009 12:11 pm    Post subject: Merging files in a PS
Reply with quote

Hi,
I have a PS that contains names of few datasets (of same DCB) and i want to merge these PS. Is there a way to accomplish this using a JCL???

e.g : FILE1 is the O/P of STEP1 and FILE1 has just the file names like

FILEA
FILEB
FILEC
FILED
...

FILEZ

And i want to merge FILEA thru FILEZ in the next step...
Is there a way to do this using IDCAMS, IEBGENER, SORT, ICETOOL etc....


Thanks in advance
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: Wed Sep 23, 2009 12:16 pm    Post subject:
Reply with quote

Previously posted on the forum
Code:

/* REXX *** COPY MULTIPLE DATASETS TO ONE OUTPUT - INPUT FILE LIST     
            CONTAINED IN DATASET ALLOCATED TO DDNAME INFILES        */
"FREE  FI(INFILES)"                                                   
"ALLOC FI(INFILES) DA('Input list dataset') SHR"                               
"EXECIO * DISKR INFILES ( STEM INFS. FINIS"                           
IDSN = ""                                                             
DO AA = 1 TO INFS.0                                                   
  IDSN = STRIP(IDSN" '"STRIP(INFS.AA)"'")                             
END                                                                   
"FREE  FI(SYSIN,SYSUT1,SYSUT2,SYSOUT,SYSPRINT)"                       
"DEL   'Output dataset'"                                             
"ALLOC FI(SYSOUT)      SYSOUT(X)"                                     
"ALLOC FI(SYSPRINT)    SYSOUT(X)"                                     
"ALLOC FI(SYSIN)       DUMMY"                                         
"ALLOC FI(SYSUT1) DA("IDSN") SHR"                                     
"ALLOC FI(SYSUT2) DA('Output dataset') NEW TRACKS SPACE(3 3)         
       RECFM(F B) LRECL(80)"                                           
"CALL *(IEBGENER)"                                                     
"FREE  FI(SYSIN,SYSUT1,SYSUT2,SYSOUT,SYSPRINT,INFILES)"               
EXIT                                                                   
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Sep 23, 2009 12:25 pm    Post subject:
Reply with quote

Hello Pranav,

Please refer the prev post used dfsort to acheive this

http://www.ibmmainframes.com/viewtopic.php?t=21303&highlight=merging+files+input+file

Let me know if you required any help regarding it.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Sep 23, 2009 12:32 pm    Post subject:
Reply with quote

Hi Pranav,

do you mean merge or copying ?

Depending on the answer and the order of the data in each file, you may not be able to use some of the utilities.


Gerry
Back to top
View user's profile Send private message
pranavaraj

New User


Joined: 03 Jan 2007
Posts: 15
Location: US

PostPosted: Wed Sep 23, 2009 1:31 pm    Post subject:
Reply with quote

Thanks expat.. But we are forbidden to use REXX... :-(

Thanks guptae.. I will try this...

Hi gcicchet,
I jus wanted to merge data in all the files to a single file...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 23, 2009 8:32 pm    Post subject:
Reply with quote

Hello,

Quote:
I jus wanted to merge data in all the files to a single file...
What does "merge" mean to you. . .

It has a standard meaning that i believe is not your meaning. Simply copying multiple files into a single file with no regard to the sequence of the data is not a merge (regardless of the number of people who misuse the term).
Back to top
View user's profile Send private message
pranavaraj

New User


Joined: 03 Jan 2007
Posts: 15
Location: US

PostPosted: Thu Sep 24, 2009 11:22 am    Post subject: Reply to: Merging files in a PS
Reply with quote

Hi guptae,
Thanks for the link.. That worked...


Hi Dick,
Sorry for any confusion... I just wanted to combine the data in all the files to one file... icon_rolleyes.gif
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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