COBOL Interview Questions

Showing Questions 21 - 23 of 23 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page:
  •  

    Can Redefines clause be used at 01 level ?

    Ramesh

    • Jun 16th, 2012

    Yes...You can define redefines clause at all levels except 66 and 88 in working-storage section....where as in file section we cant redefine at 01 level..other than this you can...and you cant redefine at occurs clause level...

    PKK

    • Dec 9th, 2011

    The REDEFINES clause can be used when the two data items have the same level number. The exceptions are when the special purpose 66 or 88 level numbers are used and when the level number is at 01 in t...

  •  

    In the example below

    05 WS-VAR1 PIC X(5),05 WS-VAR2 REDEFINES WA-VAR1 PIC 9(5),PROCEDURE DIVISION MOVE 'ABCDE' TO WS-VAR1.Now what is the value of WS-VAR1 and WS-VAR2 ?

    Jeevan Poojar

    • Apr 25th, 2021

    WS_VAR1 - ABCDE
    WS-VAR2 - A CDE

    supriya

    • Sep 5th, 2017

    Here given 05 WS-VAR2 redefines WA-VAR1 pic 9(5). means WA-VAR1 should be defined in working storage so while compiling it will throw the error. but excluding this next statement in procedure division is move abcde to ws-var1. means value of ws-var1 is =abcde

  •  

    How many bytes occupied following comp example?

    Dear Friends,

    This is regarding COBOL comp.

    PIC X(3) occupy the 3 bytes... but PIC 9(3)V9(7) COMP occupied how much bytes?

    I said in interview that 10/2 = 5 bytes. V is specified for decimal point.

    Is that correct? But interviewer looked at me differently when I said this answer?

    If you are more confident, please reply this ...thanks...

    Jyoti Kalagi

    • Feb 15th, 2023

    We can store only 9 and S not V in comp ,if we want to store decimal use comp-3 not comp

    rathna

    • Aug 17th, 2022

    N/2 for even number and than +1. (n+1/2) for odd number.
    3+7=10
    10/5= 5
    5+1=6

Showing Questions 21 - 23 of 23 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page: