Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding changing comp variable to diplayable format.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Regarding changing comp variable to diplayable format.
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: 2150
Location: At my coffee table

PostPosted: Tue Sep 25, 2007 2:02 pm    Post subject:
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    Post subject: Reply to: Regarding changing comp variable to diplayable for
Reply with quote

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

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

http://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    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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us