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

Merging of files after reading there names from another file


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

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon May 28, 2007 6:25 pm
Reply with quote

I have a requirement like this

I will be getting a file from some external sources. The file will contain names of some GDG's. The generation number may not be consecutive. My requirement is: I have to get the GDG names from the file and in the next step i want to concatenate the contents of GDG using a sort

Example

my input file contains

XX.PRESENT.DATA.GDG.G0001V00
XX.PRESENT.DATA.GDG.G0003V00
XX.PRESENT.DATA.GDG.G0009V00

In the next step I want to read the input file naems and then merge the contents of
XX.PRESENT.DATA.GDG.G0001V00,XX.PRESENT.DATA.GDG.G0003V00,XX.PRESENT.DATA.GDG.G0009V00 into a another file
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon May 28, 2007 6:28 pm
Reply with quote

You can do it using REXX.
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 06, 2007 8:34 pm
Reply with quote

This is how I would approach this:

Code:

//JOB#1    JOB (),'....',CLASS=T,....
//*
//STEP1    EXEC PGM=ICEMAN                                 
//SORTIN   DD   *                                         
XX.PRESENT.DATA.GDG.G0001V00                               
XX.PRESENT.DATA.GDG.G0003V00                               
XX.PRESENT.DATA.GDG.G0009V00                               
/*                                                         
//SORTOF1  DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO             
//SORTOF2  DD   DSN=&&T2,DISP=(,PASS),UNIT=VIO             
//SYSOUT   DD   SYSOUT=*                                   
//SYSIN    DD   *                                         
  OPTION COPY                                             
  OUTFIL FILES=1,ENDREC=1,                                 
    OUTREC=(1:C'//SORTIN   DD   DISP=SHR,DSN=',1,44,80:X) 
  OUTFIL FILES=2,STARTREC=2,                               
    OUTREC=(1:C'//         DD   DISP=SHR,DSN=',1,44,80:X) 
/*                                                         
//*                                                       
//STEP2    EXEC PGM=ICEMAN                               
//SORTIN   DD   DATA,DLM=@@                               
//JOB#2    JOB (),'....',CLASS=T,....
//*                                                       
//STEP1    EXEC PGM=ICEMAN                               
//SORTOUT  DD   SYSOUT=*                                 
//SYSOUT   DD   SYSOUT=*                                 
//SYSIN    DD   *                                         
  OPTION COPY                                             
/*                                                       
@@                                                       
//         DD   DSN=&&T1,DISP=(OLD,PASS)                 
//         DD   DSN=&&T2,DISP=(OLD,PASS)                 
//SORTOUT  DD   SYSOUT=(*,INTRDR)                         
//SYSOUT   DD   SYSOUT=*                                 
//SYSIN    DD   *                                         
  OPTION COPY                                             
/*                                                       
//*                                                       


where JOB#1 STEP1 would create DD statements for each of the GDG datasets in the input file, JOB#1 STEP2 would copy the JCL for JOB#2 to the internal reader while providing the concatenated dataset list for the SORT input.
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 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top