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
 

 

Appending data to a variable in VSAM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Appending data to a variable in VSAM
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: 3158
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 4:23 pm    Post subject:
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    Post subject: Re: Appending data to a variable in VSAM
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: 3158
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 4:37 pm    Post subject: Re: Appending data to a variable in VSAM
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 5:24 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jan 08, 2007 7:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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