yogeshwar_ade Active User Joined: 31 Aug 2006 Posts: 103 Location: INDIA
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
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?
Robert Sample Global Moderator Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
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
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'.
MOVE LV-BYTE TO WS-VALUE-BYTE. where WS-COMP-FIELD contains the value of the byte.
mmwife Super Moderator Joined: 30 May 2003 Posts: 1592
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?
enrico-sorichetti Global Moderator Joined: 14 Mar 2007 Posts: 10457 Location: italy
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
All times are GMT + 6 Hours