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

Merging files in a PS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Wed Sep 23, 2009 12:16 pm
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: 1208
Location: Bangalore,India

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

Hello Pranav,

Please refer the prev post used dfsort to acheive this

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: 1702
Location: Australia

PostPosted: Wed Sep 23, 2009 12:32 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 23, 2009 8:32 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top