View previous topic :: View next topic
|
Author |
Message |
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Hey Guys ,
I am in a bit of a soup and cud use some help right now:(
There is a field in our database.PIC X(9). This field may have leading zeroes. No problems here.
We send this field to a vendor. The layout of the vendor file has this field defined as PIC S9(9) COMP-3 VALUE ZEROS.
So what hapens to a value having leading zeroes??
The vendor is claiming that we are sending them 8 or 7 digited data. Do the leading zeroes fall off when you load to a table? (like my hair is about to!)
Note the leading zeroes are needed here!! |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Packed (comp-3) field (5 bytes) is sufficient to hold 9 numeric characters and the sign.
Check to see what the source field and target field contain in a few of the records? Do you get the same results as the vendor cites?
Dave |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
I cant go in and check the vendor sites.
The issue is they say we are sending them truncated data (bocz the zeroes are suppressed when I browse the file using layout). Bu I think the zeroes are there in the field all right. It is only getting suppressed when I try to browse it right ?
I can only see the source fields.
the source field (alphanumeric) contains 9 bytes of data starting with zeroes. |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
you need to browse output sent to vendor in HEX.
run job and create test output file
if input is c'000123456' it should be x'000123456F'
in ISPF with HEX ON looks like
00246
0135F
Dave |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Thanx dave!
I viewed that in Hex. It showed the zeroes alrite.
One last question. Are all numeric (packed and zonde) are automatically padded with zeroes?? |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
create a test program and see what happens when moving smaller numeric data items to larger packed/zoned data items.
Dave |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Dave.Just did that.
Seems like automatically padded zeroes are displayed OK when u mov them to numeric or alphanumberic from packed decimal fields. |
|
Back to top |
|
|
|