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: 239
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: 239
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: 239
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm


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