Solved

# sorting problem

Posted on 2011-02-22
691 Views
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
/*
my sort card is:
//SYSIN    DD *
SORT FIELDS=(1,4,BI,A)
/*
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

Any idea how to correct this..?
0
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

LVL 68

Accepted Solution

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

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

## Featured Post

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Starting up a Project
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
###### Suggested Courses
Course of the Month3 days, 5 hours left to enroll