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

Appending data to a variable in VSAM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sandhyapillai

New User


Joined: 04 Jan 2007
Posts: 4
Location: India

PostPosted: Mon Jan 08, 2007 4:19 pm
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 4:23 pm
Reply with quote

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

New User


Joined: 04 Jan 2007
Posts: 4
Location: India

PostPosted: Mon Jan 08, 2007 4:32 pm
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 4:37 pm
Reply with quote

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

New User


Joined: 04 Jan 2007
Posts: 4
Location: India

PostPosted: Mon Jan 08, 2007 5:10 pm
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 5:24 pm
Reply with quote

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

New User


Joined: 04 Jan 2007
Posts: 4
Location: India

PostPosted: Mon Jan 08, 2007 6:48 pm
Reply with quote

William, I found out why ! icon_smile.gif

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 7:02 pm
Reply with quote

Kind of what I was suspecting, but stranger things have happened.....grin...

Keep on truckin'

Bill
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top