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 do you reference the ksds vsam file formats from cobol programs

0 Answers  


01 b pic +9(4) How many bytes it will take for storage???

2 Answers  


what are the isolation levels and where we use it in the db2 program

3 Answers   TCS,


how can i see junk values in dclgen or in hostvariable of comp ?

0 Answers   DELL,


How to read records from flat file in reverse order through COBOL program?

14 Answers   Accenture, Broadridge, IBM, MAT, Polaris, SPIC, Syntel, TCS, Wipro,






) How do you access the migrate the data from production region to development region

1 Answers   IBM,


Explain fixed length record in cobol? with suitable example

1 Answers   IBM,


Read filea And file b write the same records in both files? Records in a but not in b record in b but not in a

3 Answers   TCS,


I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?

1 Answers   CTS, HCL,


What are the different rules to perform a Search?

0 Answers  


explain sorting techniques in cobol program?

0 Answers  


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

1 Answers  


Categories