Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8615
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 1 Wed Dec 06, 2017 1:50 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us