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
 

 

Simpler way of doing it using only one sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Fri Oct 10, 2008 3:10 pm    Post subject: Simpler way of doing it using only one sort card
Reply with quote

I have an input file with the following records



Code:


00roshni1020080910           
01RECORD  MAX  10203040506300MAX
01RECORD  MAX  20304050607100MAX
01RECORD  MAX  40506070809200MAX
01RECORD  MAX  20304050607300MAX
01RECORD  MAX  30405060708300MAX
01RECORD  MAX  40506070809300MAX
01RECORD  MAX  30405060708200MAX
0200000003



My file is 91 bytes long and the output file should have the field from 27th position till length 3 to be sorted in the order 300, 100 and then 200.
And my output should look like this

Code:


00HEADER           
01RECORD  MAX  10203040506300MAX
01RECORD  MAX  20304050607300MAX
01RECORD  MAX  30405060708300MAX
01RECORD  MAX  40506070809300MAX
01RECORD  MAX  20304050607100MAX
01RECORD  MAX  40506070809200MAX
01RECORD  MAX  30405060708200MAX
02TRAILER
               



I am trying to split the file into the three types and then merging again. but I want to know if there is any simpler method.

My sort card looks like this

Code:


SORT FIELDS=(27,3,CH,A)     
OUTFIL FNAMES=SORTO300,     
  INCLUDE=(27,3,CH,EQ,C'300')
OUTFIL FNAMES=SORTO100,     
  INCLUDE=(27,3,CH,EQ,C'100')
OUTFIL FNAMES=SORTO200,     
  INCLUDE=(27,3,CH,EQ,C'200')




I want to know if there is any simpler way of doing it using only one sort card?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Oct 10, 2008 6:28 pm    Post subject:
Reply with quote

Quote:
I want to know if there is any simpler way of doing it using only one sort card?


Yes ther is...
Code:

//SORTIN DD *                           
00ROSHNI1020080910                     
01RECORD  MAX  10203040506300MAX       
01RECORD  MAX  20304050607100MAX       
01RECORD  MAX  40506070809200MAX       
01RECORD  MAX  20304050607300MAX       
01RECORD  MAX  30405060708300MAX       
01RECORD  MAX  40506070809300MAX       
01RECORD  MAX  30405060708200MAX       
02TRAILER                               
/*                                     
//SORTOUT DD SYSOUT=*                   
//SYSIN    DD    *                     
   SORT FIELDS=(34,2,CH,A)             
   INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'00'),
                 OVERLAY=(33:C'00')),     
         IFTHEN=(WHEN=(1,2,CH,EQ,C'02'), 
                 OVERLAY=(33:C'04')),     
         IFTHEN=(WHEN=(27,3,CH,EQ,C'300'),
                 OVERLAY=(33:C'01')),     
         IFTHEN=(WHEN=(27,3,CH,EQ,C'100'),
                 OVERLAY=(33:C'02')),     
         IFTHEN=(WHEN=(27,3,CH,EQ,C'200'),
                 OVERLAY=(33:C'03'))     
   OUTREC FIELDS=(1,32)                   
/*                                       

Output is:
Code:

00ROSHNI1020080910             
01RECORD  MAX  10203040506300MAX
01RECORD  MAX  20304050607300MAX
01RECORD  MAX  30405060708300MAX
01RECORD  MAX  40506070809300MAX
01RECORD  MAX  20304050607100MAX
01RECORD  MAX  40506070809200MAX
01RECORD  MAX  30405060708200MAX
02TRAILER                       
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Fri Oct 10, 2008 7:19 pm    Post subject:
Reply with quote

Thanks a lot for the solution.

But I have a problem. I want to retain records only with the (27:3) with 300, 100 and 200. And I dont want any other records to be in the output. All my previous requirements remain the same and in addition I dont want any record with 27:3 anything other than 100, 300 and 200.
Now say my input layout is this

Code:


00roshni1020080910           
01RECORD  MAX  10203040506300MAX
01RECORD  MAX  20304050607100MAX
01RECORD  MAX  40506070809200MAX
01RECORD  MAX  20304050607300MAX
01RECORD  MAX  30405060708300MAX
01RECORD  MAX  40506070809300MAX
01RECORD  MAX  30405060708200MAX
01RECORD  MAX  30405060708150MAX
01RECORD  MAX  40506070809700MAX
01RECORD  MAX  30405060708800MAX
0200000003




and my output should look like this

Code:


00roshni1020080910           
01RECORD  MAX  10203040506300MAX
01RECORD  MAX  20304050607300MAX
01RECORD  MAX  30405060708300MAX
01RECORD  MAX  40506070809300MAX
01RECORD  MAX  20304050607100MAX
01RECORD  MAX  40506070809200MAX
01RECORD  MAX  30405060708200MAX
0200000003



My output should neglect the last three records whic have 150, 700 and 800 in the position 27:3.

Can I use omit condition for this??
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Oct 10, 2008 9:18 pm    Post subject:
Reply with quote

Roshini,

Try this DFSORT JCL

Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
00ROSHNI1020080910                                           
01RECORD  MAX  10203040506300MAX                             
01RECORD  MAX  20304050607100MAX                             
01RECORD  MAX  40506070809200MAX                             
01RECORD  MAX  20304050607300MAX                             
01RECORD  MAX  30405060708300MAX                             
01RECORD  MAX  40506070809300MAX                             
01RECORD  MAX  30405060708200MAX                             
02TRAILER                                                   
//SORTOUT DD SYSOUT=*                                       
//SYSIN    DD    *                                           
  INCLUDE COND=(1,2,SS,EQ,C'00,02',OR,                       
                27,3,SS,EQ,C'100,200,300')                   
                                                             
  INREC IFTHEN=(WHEN=(27,3,CH,EQ,C'300'),OVERLAY=(33:C'1')),
  IFTHEN=(WHEN=(27,3,CH,EQ,C'100'),OVERLAY=(33:C'2')),       
  IFTHEN=(WHEN=(27,3,CH,EQ,C'200'),OVERLAY=(33:C'3'))       
                                                             
  SORT FIELDS=(1,2,CH,A,33,1,CH,A)                           
                                                             
  OUTREC BUILD=(1,32)                                       
//*
Back to top
View user's profile Send private message
Roshnii

New User


Joined: 30 Sep 2008
Posts: 45
Location: bangalore

PostPosted: Mon Oct 13, 2008 11:14 am    Post subject:
Reply with quote

Thank you so much icon_smile.gif It worked just the way I wanted!!!! icon_smile.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 -> 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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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