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
 
Unsigined binary integer to Numeric format.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Unsigined binary integer to Numeric format.
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 10, 2009 6:23 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Sat Jul 11, 2009 9:05 pm    Post subject: Reply to: Unsigined binary integer to Numeric format.
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm

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