Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 247
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: 247
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: 247
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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us