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 Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
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 Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

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