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

How To Separate The Numerics From An Alphanumric Data Item Which Contains Both Alphabates And Numerics ?

4 Answers  


what are difference organizations in cobol and access mode in cobol? can you expalin what organization means while declaring for ksds,esds,rrds?

1 Answers   HCL,


can we use variable picture clause as xx.99 in cobol.

3 Answers  


I want to declare a field with data type Double in my COBOL program. how shall i do that ?

5 Answers  


how many times PARA-A is performed : PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1 UNTIL TIMES-COUNTER >0 PARA-A MOVE P TO Q MOVE H TO TIMES COUNTER a.10 b.1 c.11 d.0

4 Answers   TCS,






What does EXIT do ?

3 Answers   Deloitte,


What is difference between COBOL and VS COBOL II?.

1 Answers   Winsol Solutions,


9(2).99 how many bytes take? Why . consider as a byte?

2 Answers  


Please let me know how the Eject verb works for page break.. I want to know the code, how it is used.

3 Answers  


what is internal sort and external sort ? which is preferable ?

2 Answers   TCS,


How to remove 2 duplicate records and copy only one using job control language?

0 Answers  


I hv ten records in ps file and i hv say some 15 records in vsam file .i hv empno and age in ps file n empno,empname,dept n desig in vsam file. i hv 2 read the ps file n check wid matching empno in vsam file and then insert all fields from ps and vsam into db2 table....plz help in writin the procedure division

1 Answers  


Categories