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
 
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 Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

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