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

The leading zeroes fall off when you load to a table


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

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Tue Aug 30, 2005 4:09 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Aug 30, 2005 4:43 am
Reply with quote

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
View user's profile Send private message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Tue Aug 30, 2005 5:49 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Aug 30, 2005 7:40 am
Reply with quote

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
View user's profile Send private message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Tue Aug 30, 2005 8:20 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Wed Aug 31, 2005 5:38 am
Reply with quote

create a test program and see what happens when moving smaller numeric data items to larger packed/zoned data items.

Dave
Back to top
View user's profile Send private message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Wed Aug 31, 2005 6:07 am
Reply with quote

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
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top