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 we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas

3 Answers   IBM,


What is file status 92?

3 Answers  


Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?

7 Answers   Bank Of America, Mind Tree,


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

1 Answers   IBM,


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

2 Answers   TCS,






i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

0 Answers  


In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  


What is normalisation?

2 Answers   IBM,


i WANT ALL ERROR codes IN CICS and DB2

2 Answers  


Hi, My interviewer ask A calls B and C calls B, a and b are static c and b are dynamic.what happens if they compile and execute at same time.

3 Answers   iGate,


If you were passing a table via linkage, which is preferable - a subscript or an index?

3 Answers   TCS,


What are the different ways to run a COBOL DB2 program using JCL?

2 Answers  


Categories