Answered Questions

  • 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 ?

    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

    Suganya

    • May 19th, 2015

    Both ws-var-1 and ws-var-2 contain ABCDE . It wont throw any error. I executed the code and found out the result