Solved

sorting problem

Posted on 2011-02-22
2
690 Views
Last Modified: 2012-06-21
I have a simple DFSORT issue.
I give input data in sysin (obviously it is of character type)
//SORTIN   DD *          
2350                     
2199                     
450                      
360                      
295                      
2200                     
1925                     
1899                     
9900                     
3195                     
2600                     
/*      

Open in new window

my sort card is:
//SYSIN    DD *                
  SORT FIELDS=(1,4,BI,A)       
/* 

Open in new window

I am getting the same result even if i use the sort card as SORT FIELDS=(1,4,CH,A)    
The output i am getting is:
1899 
1925 
2199 
2200 
2350 
2600 
295  
3195 
360  
450  
9900 

Open in new window

                           
Any idea how to correct this..?
0
Comment
Question by:jimsweb
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 34950025
Hi,

that's a nice problem - your issue is due to left-alignment of the numerical values.

There is a special format "UFF" which might help here.

SORT FIELDS=(1,4,UFF,A)

"UFF" means "unsigned free form numeric". It's described ("IBM DFSORT Application Programming Guide") like this:

This format extracts decimal digits (0-9) from right to left anywhere in the field to form a positive number. Any         |  combination of characters is valid, but characters other than 0-9 are ignored.

wmp
0
 
LVL 8

Author Closing Comment

by:jimsweb
ID: 34950114
Thanks a ton! You are really a mainframe maestro..
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
Direct mail marketing is the act of mailing materials straight to prospective customers. This wide form of marketing is one of the oldest methods of communicating with a geographic based demographic. So is it useful in 2017 and beyond?
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question