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
 
The leading zeroes fall off when you load to a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: The leading zeroes fall off when you load to a table
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: 252
Location: Cincinnati OH USA

PostPosted: Tue Aug 30, 2005 4:43 am    Post subject:
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    Post subject:
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: 252
Location: Cincinnati OH USA

PostPosted: Tue Aug 30, 2005 7:40 am    Post subject:
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    Post subject:
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: 252
Location: Cincinnati OH USA

PostPosted: Wed Aug 31, 2005 5:38 am    Post subject:
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    Post subject: Re: URGENT: ZEROES Padded?
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    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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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