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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort & merge all the generations of GDG W/O affecting HD
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    Post subject: Reply to: Sort & merge all the generations of GDG W/O af
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    Post subject: Reply to: Sort & merge all the generations of GDG W/O af
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
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
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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