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
 

 

DFSORT/ICETOOL Requirement

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

New User


Joined: 24 May 2006
Posts: 7

PostPosted: Thu Dec 17, 2009 3:53 pm    Post subject: DFSORT/ICETOOL Requirement
Reply with quote

I have an input file which is an FB (1500 LRECL). My point of interest are two fields in them.
1. Reference number
2. Flag which needs to be set the same for the a given reference number.

The input file would like this

Input File

D1234567.........R.......
D1234567.........R.......
D1234567.........X.......
D1234567.........L.......
D1234568.........L.......
D1234568.........X.......
D1234568.........L.......
D1234568.........L.......
D1234569.........L.......
D1234569.........L.......
D1234569.................

As you can see the first 8 chars are the reference numbers which are sorted and the single byte char (which contains 'R' or 'X' or 'L' ) are the flags to be set. It would be required that all records of a specific reference number to be set with one single flag.

All records to be filled with 'R' if any one of the record contains 'R'
All records to be filled with 'X' if any one of the record contains 'X' and none of them have an 'R'
All records to be filled with 'L' if any one of the record contains 'L' and none of them have an 'R' or an 'X'.

Essentially the output record should be as below

D1234567.........R.......
D1234567.........R.......
D1234567.........R.......
D1234567.........R.......
D1234568.........X.......
D1234568.........X.......
D1234568.........X.......
D1234568.........X.......
D1234569.........L.......
D1234569.........L.......
D1234569.........L.......

I would like the above to be done with DFSORT ( ICETOOL ).
Saran
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 17, 2009 4:06 pm    Post subject:
Reply with quote

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and will be moved into the JCL forum by one of the moderators. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
saranyan_j

New User


Joined: 24 May 2006
Posts: 7

PostPosted: Thu Dec 17, 2009 4:12 pm    Post subject:
Reply with quote

Im sorry for not being specific before. We use product DFSORT and the line containing ICE201I is below

ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Thu Dec 17, 2009 5:08 pm    Post subject:
Reply with quote

Hi Saran,
Below sortstep will give you desired output...
Code:

//S1    EXEC  PGM=SORT                                     
//SORTIN DD *                                             
D1234567.........R.......                                 
D1234567.........R.......                                 
D1234567.........X.......                                 
D1234567.........L.......                                 
D1234568.........L.......                                 
D1234568.........X.......                                 
D1234568.........L.......                                 
D1234568.........L.......                                 
D1234569.........L.......                                 
D1234569.........L.......                                 
D1234569.................                                 
//SORTOUT DD SYSOUT=*                                     
//SYSOUT    DD  SYSOUT=*                                   
//SYSIN    DD  *                                           
  SORT FIELDS=(1,8,CH,A,1501,1,CH,A)                         
  INREC IFTHEN=(WHEN=(18,1,CH,EQ,C'R'),OVERLAY=(1501:C'1')),
        IFTHEN=(WHEN=(18,1,CH,EQ,C'X'),OVERLAY=(1501:C'2')),           
        IFTHEN=(WHEN=(18,1,CH,EQ,C'L'),OVERLAY=(1501:C'3')),           
        IFTHEN=(WHEN=NONE,OVERLAY=(1501:C'4'))                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(1502:SEQNUM,8,ZD,RESTART=(1,8))), 
         IFTHEN=(WHEN=GROUP,BEGIN=(1502,8,ZD,EQ,1),PUSH=(18:18,1))     
  OUTFIL BUILD=(1,1500)                                               
/*                                                                   

Output will be...
Code:

D1234567.........R.......       
D1234567.........R.......       
D1234567.........R.......       
D1234567.........R.......       
D1234568.........X.......       
D1234568.........X.......       
D1234568.........X.......       
D1234568.........X.......       
D1234569.........L.......       
D1234569.........L.......       
D1234569.........L.......       
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 get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 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 ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Cards mainframe developer requirement... capricorn Mainframe Jobs 0 Sun Sep 11, 2016 9:57 am


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