|
View previous topic :: View next topic
|
| Author |
Message |
anandinmainframe
Active User

Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hi all,
These are all the questions asked in interview please let me know the correct answer.
When there is a change in the field length of a particaular field in a table what will you do?
Answer i told: I will do an impact and see what are all the programes use this field and will inform DBA about the field in the table.
If i declare pic(x) in 88 level
and in the sub variable as value abc which value will be considered.
Answer: i dont know |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
1. Usually, the dba is involved with the re-definition of the field. In additon to programs, there are screens, reports, generated files, etc.
2. There is no "pic" in an 88 level. . . Suggest you look at the COBOL Language Reference available via the "IBM Manuals" link at the top of the page. |
|
| Back to top |
|
 |
Binop B
Active User

Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Dick,
| Quote: |
| There is no "pic" in an 88 level. . . |
Guess the owner meant picture definition of the level variable before 88 ...
Hi Anand,
| Quote: |
| If i declare pic(x) in 88 level and in the sub variable as value abc which value will be considered. |
You could have try this on your own.. Anyway here are my testing results...
Code
| Code: |
05 WS-WORK2 PIC X(01).
88 WORK2-CHK VALUE 'ABC'.
PROCEDURE DIVISION.
*
*
MOVE 'A' TO WS-WORK2.
DISPLAY 'VALUE IS ' WS-WORK2.
IF WORK2-CHK
DISPLAY 'CONDITION SATISFIED...'
END-IF.
*
MOVE 'B' TO WS-WORK2.
DISPLAY 'VALUE IS ' WS-WORK2.
IF WORK2-CHK
DISPLAY 'CONDITION SATISFIED...'
END-IF.
*
MOVE 'C' TO WS-WORK2.
DISPLAY 'VALUE IS ' WS-WORK2.
IF WORK2-CHK
DISPLAY 'CONDITION SATISFIED...'
END-IF. |
Compilation Messages
| Code: |
14 IGYGR1056-E "VALUE" literal "'ABC'" exceeded the length specified in the "PICTURE" definition. The literal was truncated to the "PICTURE" definition length.
52 IGYPG3173-W The result of the comparison of operands WS-WORK2 and ABC is known at compile time, based on the attributes of the operands. Unconditional code was generated.
Same message on line: 59 66 |
Output
| Code: |
VALUE IS A
VALUE IS B
VALUE IS C |
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
If i declare pic(x) in 88 level
and in the sub variable as value abc which value will be considered. |
I only chose to mention the non-existant "pic" in the 88. The rest of the question needs to be fixed as well. There is neither "subvariable" nor "sub variable" in COBOL. . .
On systems i support, the posted test could not be run. The standard compile jcl would not have permitted the linkedit of the code that generated an E-level error. . .  |
|
| Back to top |
|
 |
Binop B
Active User

Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
| Quote: |
| On systems i support, the posted test could not be run. The standard compile jcl would not have permitted the linkedit of the code that generated an E-level error. . . |
Very true... ...
Had link-edited and executed the program to show the owner how the system would behave...  |
|
| Back to top |
|
 |
|
|