Interview Q

other mainframe interview questions

Moderators: Anuj Dhawan, Moderator Group

Post Reply
tpkumar77
Member
Posts: 16
Joined: Mon Jul 13, 2009 1:01 am

Interview Q

Post by tpkumar77 » Thu Aug 13, 2009 11:17 am

I was asked the following interview question

suppose there are two variables:

WS-VAR1 Pic X(2)
WS-VAR2 PicX(100)

how do you assign a value * to these two variables such that the two variables contain(VAR1 and VAR2 should be filled with *) the value "* "
(without using MOVE,Initialize)

Thanks
Kumar
Regards,
Kumar

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Aug 13, 2009 12:18 pm

Usually purpose of interview part of the Forum is, you tell us what was your answer then there can be suggestions/queries to tell/ask why the answer is correct or wrong.

So, please tell us what was your answer.
Regards,
Anuj

rameshkumar2030
Member
Posts: 1
Joined: Wed Aug 19, 2009 4:43 pm

Post by rameshkumar2030 » Wed Aug 19, 2009 5:01 pm

Sorry tel me the answer, Thank you

http://www.usjobcareer.com
jobs in chennai

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Aug 19, 2009 5:22 pm

I'll try to answer, but why are you sorry?
Regards,
Anuj

sooraj184
Member
Posts: 4
Joined: Thu Oct 15, 2009 7:13 pm

Post by sooraj184 » Tue Nov 03, 2009 8:10 pm

Kumar,

You can use redefine clause while declaring the datasets in working storage!....

Ex:

01 WS-VAR1 PIC X(2).
01 WS-VAR2 REDEFINES WS-VAR1 PICX(100).

So both the data items will have the same value as they uses the same memry space.....Hope this helps!

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Wed Nov 04, 2009 10:35 am

We may need to use VALUE clause.
Natarajan
Chennai

sooraj184
Member
Posts: 4
Joined: Thu Oct 15, 2009 7:13 pm

Post by sooraj184 » Wed Nov 04, 2009 1:51 pm

Yes.... I missed it we need a value clause....

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others