View previous topic :: View next topic
|
Author |
Message |
Sandhyapillai
New User
Joined: 04 Jan 2007 Posts: 4 Location: India
|
|
|
|
Hi,
I have a question on VSAM. I have a program that appends leading zeros to a variable, (say the variable conmtains a value of 123 and my program makes it 000123) to accomodate all the digits in the variable. The program is succesful but my output file still contains the value for variable as 123. Help !
Thanks,
Sandhya |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
How is the data defined?
What is its picture, X or 0 and its size?
What is the key length defined to VSAM? |
|
Back to top |
|
|
Sandhyapillai
New User
Joined: 04 Jan 2007 Posts: 4 Location: India
|
|
|
|
The data is defined to be 9(14). The key length of the record is 13. But the variable I am talking about happens to be out of the key.
This is how it appears
RR-ITEM-SCAN-ID
14/NUM
(301-314)
66-------------
** TOP OF DATA
73621001923
and I am expecting it to appear like
RR-ITEM-SCAN-ID
14/NUM
(301-314)
66-------------
** TOP OF DATA
00073621001923 |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sandhyapillai wrote: |
The data is defined to be 9(14). The key length of the record is 13. But the variable I am talking about happens to be out of the key.
This is how it appears
Code: |
RR-ITEM-SCAN-ID
14/NUM
(301-314)
66-------------
** TOP OF DATA
73621001923
and I am expecting it to appear like
RR-ITEM-SCAN-ID
14/NUM
(301-314)
66-------------
** TOP OF DATA
00073621001923 |
|
Question is: Is the display suppressing the leading zeros or something else? Can you expand further? |
|
Back to top |
|
|
Sandhyapillai
New User
Joined: 04 Jan 2007 Posts: 4 Location: India
|
|
|
|
I don't think the display is suppressing it. And I have the variable initialised in my program. So I am wondering why the zeros just don't appear ! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What are you using to display the field:
Code: |
RR-ITEM-SCAN-ID
14/NUM
(301-314)
66-------------
** TOP OF DATA
73621001923 |
Can you programmaticly verify the zeros are currently X'40's? |
|
Back to top |
|
|
Sandhyapillai
New User
Joined: 04 Jan 2007 Posts: 4 Location: India
|
|
|
|
William, I found out why !
Tat was because File AID usually suppresses the leading zeros while displaying the data. I tried copying it into a flat file and then viewed it using 3.4 and the zeros were there indeed !!
Thnx much, anyways ! |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Kind of what I was suspecting, but stranger things have happened.....grin...
Keep on truckin'
Bill |
|
Back to top |
|
|
|