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

Initialization


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Thu Dec 10, 2009 4:48 pm
Reply with quote

Hi,

I have variables declared as below

01 WS-VAR.
05 WS-A PIC x(10).
05 WS-B PIC x(7) value 'SHRIRAM'.

My questions are
1. What will happen if i will initialize WS-VAR?
2. If it will move spaces in both the variable WS-A and WS-B, then what should we do to retain the values of WS-B after INITIALIZATION?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 10, 2009 5:00 pm
Reply with quote

The idea of the interview questions forum is that you give your answers and the forum members will tell you if you are correct or not, and then help you understand the correct answer if needed.
Back to top
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Thu Dec 10, 2009 5:02 pm
Reply with quote

My Answers were
1. If we will Initaialize then both the variable will have spaces.
2. I was not able to give answer of second one.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 10, 2009 5:25 pm
Reply with quote

I suppose changing WS-B to FILLER would do.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Thu Dec 10, 2009 5:29 pm
Reply with quote

Hi,


Srihari's answer is correct and the other option is not to give the variable name.


see this link for more info...

www.3000newswire.com/subscribers/InCobol-9905.html
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 10, 2009 9:01 pm
Reply with quote

Hello,

If only WS-A was initialized, WS-B would remain unchanged.

And the WS-B name would still be usable. . .

A rather poor question, imho.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts % free space issue of the Storage Gro... JCL & VSAM 6
No new posts CICS logoff and commare initialization CICS 1
No new posts Initialization IMS DB/DC 3
No new posts Variable initialization error COBOL Programming 8
No new posts Initialization of DS and DC variable ... PL/I & Assembler 7
Search our Forums:

Back to Top