ID DIVISION.
PROGRAM-ID. PLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VAR1 PIC 9(2).
01 VAR2 PIC X(2).
PROCEDURE DIVISION.
ACCEPT VAR2.
MOVE VAR2 TO VAR1.
STOP RUN.

if i give 'PI' in var2 then what will b output of progr.
any abend?????

Answers were Sorted based on User's Feedback



ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / giri12

SOC7

Is This Answer Correct ?    13 Yes 0 No

ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / dharma

U will not get SOC7 . but u will get unpredicatble results

Is This Answer Correct ?    3 Yes 0 No

ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / dev

ABEND=S000 U4038 REASON=00000001. I have tested the program.

Is This Answer Correct ?    3 Yes 1 No

ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / mdvasanth86

SOC 7 only when you do some arithmetic operation on it...
Displaying it will probably only give you unpredictable results.

HTH

Is This Answer Correct ?    2 Yes 0 No

ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / piyush mani

i know soc7 abend should b the result but if i display var1 then program is running without any abend and output of program is absurd so i asked this question..

Is This Answer Correct ?    1 Yes 0 No

ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE ..

Answer / dimpy19

No abend
but unpredictable result

WORKING-STORAGE SECTION.
01 VAR1 PIC 9(2).
01 VAR2 PIC X(2).
PROCEDURE DIVISION.
ACCEPT VAR2.
MOVE VAR2 TO VAR1.
DISPLAY VAR1.
DISPLAY VAR2.
STOP RUN.


//STEP02 EXEC PGM=COB7
//STEPLIB DD DSN=DEA.SIQAGH.LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
PI
/*



output
P9
PI

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

give the examples for strings and unstrings in cobol

2 Answers   IBM,


What is the maximum size of a 01 level item in COBOL I? in COBOL II?

2 Answers   IBM, RBS,


What is CALL statement in COBOL?

4 Answers  


Give some advantages of REDEFINES clause?

2 Answers   Syntel,


How to delete the records of a dataset through cobol programme?We should not use jcl utilitities like IDCAMS.

2 Answers  






I have a table with 3 dimensions like this : 01 ws-table 04 ws-page occurs 3 08 ws-column occurs 2. 12 ws-record occurs 20 pic x(40). How to code with PERFORM varying with 3 dimension...I forgot..

2 Answers   EDS,


Study the DATA DIVISION entries and the three PROCEDURE DIVISION entries given below: 01 END-OF-FILE-SWITCH PIC XXX. 88 NO-MORE-RECS VALUE "YES". 88 MORE-RECS VALUE "NO". (i) READ SAMPLE-FILE AT END MOVE "YES" TO NO-MORE-RECS. (ii) IF NO-MORE-RECS = "YES" GO TO LAST-PARA. (iii) IF NO-MORE-RECS GO TO LAST-PARA. Which are wrong? (a) (i) and (ii) (b) (ii) and (iii) (c) (i) and (iii) (d) all

5 Answers   TCS,


Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya

2 Answers   CSC,


The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND

10 Answers   Huawei, IBM, TCS,


What compiler option would you use for dynamic linking?

2 Answers  


PERFORM ACCUMULATE-TOTALS VARYING A FROM 1 BY 2 UNTIL A >2 AFTER B FROM1 BY 1 UNTIL B>2 AFTER C FROM 2 BY -1 UNTIL C<2 How many times the paragraph ACCUMULATE-TOTALS would be exicuted?

5 Answers   TCS,


Hi Devolopers.. i need ur help.. i have 3 years of exp in Manual testing and SQL, next month onwards i shifted in to MAINFRAME TESTING... i have ZERO Knowledge abt mainframes.... PLS SUGGEST ME WHAT I LEARN in AMEERPET? mainframe testing or mainframe total devolopment subject... AS a devoloper u know every thing tester what to do PLSSSSSSSSS help me ITS VERY URGENT...

1 Answers  


Categories