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
Answer / dharma
U will not get SOC7 . but u will get unpredicatble results
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / dev
ABEND=S000 U4038 REASON=00000001. I have tested the program.
| Is This Answer Correct ? | 3 Yes | 1 No |
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 |
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 |
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 |
What are the two search techniques ?
i have the following varibles in the working storage 05 ws-A PIC X(30) VALUE 'ABCDEFGHIJKLMNOPQRESTUVWXYZ ' 05 WS-B REDEFINES WS-A 10 WS-B1 PIC X(10). 10 WS-B2 PIC 9(10). 10 WS-B3 PIC X(10). If I Display B1, B2 and B3 respectively, what is the value displayed in B2
diffrence between z(2) and z9(2)
In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
what is SYNCHRONIZATION?
How to covert given string into ASCII value in COBOL/MF COBOL
I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?
What is a report item?
What is the difference between working storage copybook and linkage section copybook?
In an array processing what is the thing that can be done by using subscripts but not by using index
SIGN TRAILING SEPARATE field occupy ?
What is the difference between Global and External Variables?