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 NUMERIC

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

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Tue Nov 01, 2011 12:02 pm    Post subject: SORT NUMERIC
Reply with quote

Hi All,
I would like numeric sort using jcl.Please find the below situation.

My dataset have the below records

Code:
raja                      4     male
ram                       3     male
saravanakumar             15    male
rajay                     4     male
ramy                      73    male
saravanakumar             655   male

I want sort the above records using the 2nd columns( 3 char length).

The result would be the below

Code:
ram                       3     male
rajay                     4     male
raja                      4     male
saravanakumar             15    male
ramy                      73    male
saravanakumar             655   male



I used
SORT FIELDS=(27,3,ZD,A)
But it seems the results are not expected ..
it is consider 3 as 300 and 4 as consider as 400.

How to put sort jcl ? Could you please any one help me ..
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Nov 01, 2011 10:13 pm    Post subject:
Reply with quote

cmsmoon,
You can use UFF to sort.

Code:
//STEP0001 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                     
RAJA                      4     MALE
RAM                       3     MALE
SARAVANAKUMAR             15    MALE
RAJAY                     4     MALE
RAMY                      73    MALE
SARAVANAKUMAR             655   MALE
/*                                   
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                     
    SORT FIELDS=(27,3,UFF,A),EQUALS 
/*                                   

OUTPUT
Code:
RAM                       3     MALE
RAJA                      4     MALE
RAJAY                     4     MALE
SARAVANAKUMAR             15    MALE
RAMY                      73    MALE
SARAVANAKUMAR             655   MALE

Thanks,
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Wed Nov 02, 2011 7:15 am    Post subject:
Reply with quote

Great!!!!
It works fine..Thank you
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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