IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

sorting signed variable considering it as unsigned


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinodkumarrs

New User


Joined: 31 Mar 2008
Posts: 8
Location: india

PostPosted: Wed Apr 09, 2008 10:59 pm
Reply with quote

Hi,
I want to sort a file such that a particular field should be treated without sign.The field is given UFF format, but i am not getting the desired output.
I am using ICETOOL and the sort card is
SORT FIELDS=(1,80,CH,A,
81,7,UFF,A,
88,8,CH,A,
104,47,CH,A)
The expected output is
Code:
<--80---><--7--><---8--><--8---><---47---->
XXXXXXXXX000100}00074568YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000100{00074568YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000110}00032145YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000110{00032145YYYYYYYYXXXXXXXXXXX


But the current output is
Code:
<--80---><--7--><---8--><--8---><---47---->
XXXXXXXXX000100}00074568YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000110}00032145YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000100{00074568YYYYYYYYXXXXXXXXXXX
XXXXXXXXX000110{00032145YYYYYYYYXXXXXXXXXXX


please suggest a solution..

regards,
Vinod
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 10, 2008 12:51 am
Reply with quote

Those are ZD values with C and D signs. You can't use UFF format for those type of values.

Are you trying to treat all of the ZD values as if they had C signs ... so for example X'F0F0F0F1F0F0D0' (-1000) should be treated as X'F0F0F0F1F0F0C0' (+1000)?

What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
vinodkrs

New User


Joined: 25 Mar 2008
Posts: 10
Location: india

PostPosted: Thu Apr 10, 2008 9:34 am
Reply with quote

Yes, i need only the value of the variable. For example +1000 and -1000 should be treated same so they should be grouped together. The RECFM is FB and the LRECL is 2900
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 10, 2008 10:06 pm
Reply with quote

If you replace

81,7,UFF,A

with

81,6,BI,A,87.4,0.4,BI,A

you will get what you want. This tells DFSORT to ignore the sign (first nibble) in the last byte.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 10, 2008 10:42 pm
Reply with quote

Frank Yaeger wrote:
81,6,BI,A,87.4,0.4,BI,A
Cute, I was wondering just how you would do it.....
Funny thing is that just this morning, while searching for another problem (something to do with dynamically creating an OUTREC statement with a SEQNUM built into it), I discovered the bit selectiveness of the BI format.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 10, 2008 11:04 pm
Reply with quote

DFSORT has had bit sorting for decades, but for some reason people tend to forget it's there. It does come in handy sometimes.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top