Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us