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 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 Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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