Page 1 of 1

In Line Perform ques

Posted: Mon Feb 06, 2012 9:25 pm
by nareshv_99
i was asked the below que in CSC interview

01 WS-VAR PIC X(1) VALUE 0.


in procedure division

PERFORM WS-VAR 1 BY 1 UNTIL WS-VAR >= 10
DISPLAY "HELLO"
END-PERFORM.

you know the question rt.. how many times HELLO will be displayed in spool ?

Posted: Mon Feb 06, 2012 10:07 pm
by dbzTHEdinosauer
well,
why don't we start off with you telling us how a PIC X(1) can ever be GE 10?

Posted: Tue Feb 07, 2012 8:43 am
by nareshv_99
answer it dude..
interviewer will confuse you.. ;)

Posted: Thu Feb 09, 2012 7:50 pm
by tamilselvan.sampath
it will goes to infinite loop......

Posted: Thu Feb 09, 2012 10:10 pm
by nareshv_99
yep.. i was asked this question thru telephone.. so i didn't pay attention to the pic clause of var..

Posted: Fri Feb 10, 2012 3:36 pm
by Anuj Dhawan
nareshv_99 wrote:yep.. i was asked this question thru telephone.. so i didn't pay attention to the pic clause of var..
But the picture clause will make a difference and it won't be an infinite loop then if the variable in question is of PIC X(2).