we can use set true for condition names..
similarly can we code set to false in cobol pgm?
will it work?



we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it..

Answer / shakilaashwin

you can use 'SET condition-name TO FALSE' but with little
change in the data item declaration

Example is below :

01 WS-EOF-FLAG PIC X(1)VALUE 'N'.
88 WS-EOF-FLAG-N VALUE 'N' WHEN SET FALSE 'Y'.

PROCEDURE DIVISON.
100-MAIN-PARA.
DISPLAY 'PROG STARTS'.
DISPLAY 'FLG VALUE AFTER - ' WS-EOF-FLAG.
SET WS-EOF-FLAG-N TO FALSE.
DISPLAY 'FLG VALUE BEFORE- ' WS-EOFFLAG.
STOP RUN.

Is This Answer Correct ?    8 Yes 9 No

Post New Answer

More COBOL Interview Questions

How to delete leading spaces/blank in COBOL ? Example:- 01 data-name-1 pic x(220) " English is a language". I would like to delete leading spaces.

7 Answers   Financial Services,


a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?

4 Answers  


i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?

2 Answers  


can I copy book which contain db2 statment in procedure divion?

2 Answers   Bank Of America,


hw to create 3 dimensional array & hw to access it?

1 Answers  


Program A calls program B. Will the working storage variables declared in program B be initialized every time it is called by program A or will the values be retained until the end of program A?

7 Answers  


Consider the following COBOL entries: 05 X PIC 99 VALUE 10. SUBTRACT 20 FROM X. The resultant value of X wil be

7 Answers   TCS,


Differentiate COBOL and COBOL-II?

0 Answers  


what will be the output when a)pic 9(6)value 000178 is moved to pic ***,***. b)pic 9(5) value 57397 is moved to pic $$,$$9.

5 Answers  


How To move a value to an array using move verb?

3 Answers   IBM,


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


What is the figurative constant in cobol?

1 Answers  


Categories