Solved

sorting problem

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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