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

Sort Issue


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

New User


Joined: 16 Nov 2008
Posts: 3
Location: Melbourne

PostPosted: Wed Aug 04, 2010 10:58 pm
Reply with quote

I have one requirement which I need to achieve using sort.

Input
Code:
B no   Cust no/Acct no   Custname/Acct name     prod    Sub prod

2       300             CCC                     SS      10   
2       400             AAA
3       600             BBB                     VV      20
3       500             ZZZ                     VV      20
3       200             DDD



If Prod and Sup prod are spaces that means 2nd column contains cust no and 3rd contains Customer name
If Prod and Sup prod are not spaces then the 2nd column contains Acct no and 3rd contains Acct name


Expected output

Code:
B no    Cust no/Acct no   Custname/Acct name    prod       Sub prod

2       400             AAA
2       300             CCC                     SS      10
3       200             DDD
3       500             ZZZ                     VV      20
3       600             BBB                     VV      20



Sorting Order - Customer records and Account records

For customer records sorting order is Branch no, customer name, customer no and
for Account records the sorting order is Branch no, Account no and Account name.


Please provide the sort card 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: Wed Aug 04, 2010 11:11 pm
Reply with quote

harikumar2804,

The following DFSORT JCL will give you the desired results.
Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
----+----1----+----2----+----3----+----4----+----5----+----6---
2       300             CCC                     SS      10     
2       400             AAA                                   
3       600             BBB                     VV      20     
3       500             ZZZ                     VV      20     
3       200             DDD                                   
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,1)),                   
  IFTHEN=(WHEN=(49,2,CH,EQ,C' ',AND,57,2,CH,EQ,C' '),         
  OVERLAY=(82:25,3,9,3)),                                     
  IFTHEN=(WHEN=NONE,OVERLAY=(82:9,3,25,3))                     
  SORT FIELDS=(81,7,CH,A),EQUALS                               
  OUTREC BUILD=(1,80)                                         
//*
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts CICS-Db2 connection issue CICS 1
No new posts Simplify SORT CARD to combine INREC a... DFSORT/ICETOOL 6
Search our Forums:


Back to Top