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

Sort & merge all the generations of GDG W/O affecting HD


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

New User


Joined: 29 Jan 2008
Posts: 14
Location: Chennai

PostPosted: Wed Nov 10, 2010 3:49 pm
Reply with quote

Hi,

I have a requirement as follows.

The input for sort is the GDG base. Each generation is as follows.

File1
Code:

UHDR20101101
ZZZZ00001
BBBB00002
ZZZZ00001
UTRL000005


File2
Code:

UHDR20101102
ZZZZ00001
AAAA00002
UTRL000004


The expected output is as follows.
Code:

UHDR20101101
BBBB00002
ZZZZ00001
UTRL000005
UHDR20101102
AAAA00002
ZZZZ00001
UTRL000004


The keypoints to attain this particular output file are
1. The trailer and header should not be affected.
2. The duplicate records found within that particular header and trailer only should be removed. If the same record is found in another file, it should not be disturbed.
3. sort the records within that particular header and trailer in increasing order.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 10, 2010 10:28 pm
Reply with quote

nithyaroslin,

Assuming that the GDG generations all have an LRECL of 80 and FB recfm, the following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL     
//TOOLMSG  DD SYSOUT=*           
//DFSMSG   DD SYSOUT=*           
//IN       DD DSN=Your GDG base,DISP=SHR
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  SELECT FROM(IN) TO(OUT) ON(81,4,CH) ON(1,10,CH) FIRST USING(CTL1)
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(84:C'2')),                     
  IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'UHDR'),                   
     END=(1,4,CH,EQ,C'UTRL'),PUSH=(81:ID=3)),                     
  IFTHEN=(WHEN=(1,4,CH,EQ,C'UHDR'),OVERLAY=(84:C'1')),             
  IFTHEN=(WHEN=(1,4,CH,EQ,C'UTRL'),OVERLAY=(84:C'3'))             
                                                                   
  OUTFIL FNAMES=OUT,BUILD=(1,80)                                   
//*
Back to top
View user's profile Send private message
nithyaroslin

New User


Joined: 29 Jan 2008
Posts: 14
Location: Chennai

PostPosted: Thu Nov 11, 2010 11:02 am
Reply with quote

Wow.... icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif

Thankyou very much! It's working!!!! The grouping concept is really wonderful... Thanks again!
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top