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

Regarding changing comp variable to diplayable format.


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

New User


Joined: 01 Aug 2007
Posts: 6
Location: chennai

PostPosted: Tue Sep 25, 2007 10:59 am
Reply with quote

Hi,
I have a requirement in which i have to convert a comp variable (binary) to an displayable format, i have used a sort card for this.It is working fine for positive numbers but for negative numbers it is displaying some junk value. the sort card is:

Code:

  SORT FIELDS=COPY                                               
  OUTFIL OUTREC=(1:7X,8:63,8,16:4X,20:72,4,BI,EDIT=(STTTTTTTTT),   
              SIGNS=(,-,,),30:50X)


Input record lenght -- 450

input field

Code:

BASE   PIC X(08).           start pos --63   len-8
NUMBER   PIC S9(9) USAGE COMP.    start pos --72   len-4



input file data:

Code:

   base       number
   02610244       -345678901
   03667163       -678901234
   03912421        890123456
   0396468C       -987654321
   04064428        876543210


output obtained:

Code:

   base           number
   02610244        949288395
   03667163        616066062
   03912421        890123456
   0396468C        307312975
   04064428        876543210


Please let me know if there is any special way to handle negative numbers or is something wrong in my sort card.
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: Tue Sep 25, 2007 2:02 pm
Reply with quote

Try replacing the BI (unsigned binary) with FI (signed binary).....
Back to top
View user's profile Send private message
sujesh_prasannan
Currently Banned

New User


Joined: 01 Aug 2007
Posts: 6
Location: chennai

PostPosted: Tue Sep 25, 2007 2:45 pm
Reply with quote

hi ,
thanks... it worked fine.......
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: Tue Sep 25, 2007 8:38 pm
Reply with quote

For more information on the various formats supported by DFSORT, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.0?DT=20060615185603
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top