Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
sorting signed variable considering it as unsigned

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: sorting signed variable considering it as unsigned
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 Moderator


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

PostPosted: Thu Apr 10, 2008 12:51 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Apr 10, 2008 10:06 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 10, 2008 10:42 pm    Post subject:
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 Moderator


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

PostPosted: Thu Apr 10, 2008 11:04 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us