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

Unsigined binary integer to Numeric format.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Fri Jul 10, 2009 6:01 pm
Reply with quote

Hello Everyone,

I am not clear whether I am using right term or not but pardon my knowledge.

I am getting an input field which is define as AN(Alpha Numeric) but in the last byte data coming as unsigned Binary integer format( told by my UK co-ordinator). please have screen shot for same

15 MRQ-UNIQUE 1/AN X'00' ----> In file-aid format

In normal view with hex on

Code:
999997 DA
FFFFFF0CC4
9999970410

"Code"d


Here actual one byte field is in between after 999997 and before DA( Have taken more fields for better understanding)

I also have attached screen shot.

Initially I though this is junk value, so inspect all junk value into spaces and ran the program ..Completed successfully ( As XML command throw an exception on junk data)

But now they have ask me to converts them into normal numeric format...

I tried by doing redefine logic but it's not working.

Could you plz help to convert them into 99 format ??

Hoping you got my query?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 10, 2009 6:23 pm
Reply with quote

The byte is a LOW-VALUE; you need to find out what, exactly, the field is -- from either the documentation, your coworkers, or wherever the file is coming from. It could represent a string trailer character in C (which uses a LOW-VALUE to denote end of string), or it could represent a numeric value between 0 and 255. Can the byte be any value in its range, or is it restricted to only a few values?

The general solution to convert the byte to a value is
Code:
05  WS-2-BYTES.
    10  FILLER                   PIC X(01) VALUE LOW-VALUES..
    10  WS-VALUE-BYTE            PIC X(01).
05  WS-COMP-FIELD                REDEFINES WS-2-BYTES

                                 PIC 9(04) COMP.
05  LV-BYTE                      PIC X(01) VALUE X'05'.

PROCEDURE DIVISION.
    MOVE LV-BYTE                TO  WS-VALUE-BYTE.
where WS-COMP-FIELD contains the value of the byte.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jul 11, 2009 8:58 pm
Reply with quote

Hi,

If you can send the data def (including PIC) of the problem field and a verbal description of how the X'00' field is used in the system, it can go a long way in helping us provide a solution for you.

Also, what other values (if any) have occupied the X'00' field?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jul 11, 2009 9:05 pm
Reply with quote

the best way to solve the puzzle would be to investigate the specifications
of the program creating the file.

very little can be guessed simply looking at the data/screen shot
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Populate last day of the Month in MMD... SYNCSORT 2
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 InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top