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

what is the output of the following interview question


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top