Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sorting problem

Posted on 2011-02-22
2
Medium Priority
?
697 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 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