IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT NUMERIC


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Tue Nov 01, 2011 12:02 pm
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: 577
Location: USA

PostPosted: Tue Nov 01, 2011 10:13 pm
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: 75
Location: Chennai

PostPosted: Wed Nov 02, 2011 7:15 am
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Simplify SORT CARD to combine INREC a... DFSORT/ICETOOL 6
No new posts Sort card to generate the DSN DFSORT/ICETOOL 17
Search our Forums:


Back to Top