Solved

sorting problem

Posted on 2011-02-22
2
682 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now