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 Issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort Issue
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    Post subject:
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    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
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
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