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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top