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
 

 

what is the output of the following interview question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Fri Feb 24, 2006 9:22 am    Post subject: what is the output of the following interview question
Reply with quote

what is the output of the following
01 grp-1.
05 sub-ft1 pic xx value'ab'.
05 sub-ft2 pic x(6) value spaces.
05 grp-2 redefine grp1.
02 sub-ft2 pic xx.
02 sub-ft3 pic xx.
02 filler picx(4).
if sub-ft1 not=space
display'sub-ft1'.
move "abdefc" to grp-1.
if sub-ft2 =space
display'sub-ft2'
else
display'sub-ft3'
display'end'
else
display'space,
display'end'.
Back to top
View user's profile Send private message

narenndra_tallapireddy

New User


Joined: 12 Jul 2005
Posts: 5

PostPosted: Fri Feb 24, 2006 9:41 am    Post subject:
Reply with quote

please make sure that the level nos which you mentioned are correct if it is the answer will abcdef of group-1.

i think the level nos must be identical when we are redifing the data elements of one group to another.other wise it will not redefine. simply it will move abcdef to group-1 .

if iam mistaken please correct me.

narendra.
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Fri Feb 24, 2006 9:52 am    Post subject:
Reply with quote

I guess this code will not compile. REDEFINES should be at the same level only.
Back to top
View user's profile Send private message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Fri Feb 24, 2006 10:02 am    Post subject: Re: interview question
Reply with quote

yes i did wrong the level number should b same
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Feb 25, 2006 8:29 am    Post subject:
Reply with quote

Hi priya,

You've also got 2 else following the last if. That's a compile error too.
Back to top
View user's profile Send private message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Sat Feb 25, 2006 7:33 pm    Post subject: Re: what is the output of the following interview question
Reply with quote

hi mmwife,

bt they asked like this in my interview.can u tell me the ans...
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Feb 26, 2006 4:16 am    Post subject:
Reply with quote

Hi Priya,

If what you posted is what they gave you, your only answer has to be:

Your ques has 2 syntactical errors. The 05 levels must be subsumed under one or more of the three 02 levels. You have them BEFORE the 02 levels.

The last IF stmt is followed by two ELSE stmts. Only one is permissable.

The code will not compile successfully.

I don't know why they did this. Maybe they made a mistake. Maybe it's a trick question.
Back to top
View user's profile Send private message
Vinodc

New User


Joined: 01 Dec 2005
Posts: 33
Location: Prague

PostPosted: Sun Feb 26, 2006 4:19 am    Post subject: what is the output of the following interview question
Reply with quote

Hi spriya,

The answer to this is that you cant actually get any output. Thats because you cant successfully compile this peice of code. While compilation you will get IGYPS2011 error saying an else doesnt have a matching if. Maybe this was the answer your interviewer was expecting.

Vinod Chawda
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 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 How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am


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