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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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