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 spaces after numbers

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

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Nov 21, 2007 3:18 am    Post subject: Sort spaces after numbers
Reply with quote

Hi,

I have the following situation

A 20070101 20071231
A 20071101 20071130
B 20071101
B 20071101 20071130

I need the following output

A 20071101 20071130
A 20070101 20071231
B 20071101 20071130
B 20071101


Basicly need to sort on date fields but the spaces should have priroty after numbers.
Please can you let me know how to achieve it using sort.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 21, 2007 3:27 am    Post subject:
Reply with quote

It's not clear what you're actually sorting on. Please show the SORT statement you're using and indicate which field or fields have the dates that should have blanks collated after the numbers
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Nov 21, 2007 3:31 am    Post subject: Reply to: Sort spaces after numbers
Reply with quote

Hi,

The file layout is this

ID Date1 Date2
A 20070101 20071231
B 20071101
A 20071101 20071130
B 20071101 20071130

Basicly i need to sort in on id, date2 and then date1.
There are spaces in date2 field so I want then to have least priority.

ID Date1 Date2
A 20071101 20071130
A 20070101 20071231
B 20071101 20071130
B 20071101
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 21, 2007 4:07 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
A   20070101 20071231
B   20071101
A   20071101 20071130
B   20071101 20071130
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  ALTSEQ CODE=(40FA)
  OPTION NOCHALT
  SORT FIELDS=(1,1,CH,A,14,8,AQ,A,5,8,CH,A)
/*
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Nov 21, 2007 9:12 pm    Post subject: Reply to: Sort spaces after numbers
Reply with quote

Thanks Frank..

It worked perfect...
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