how to change picture class of copy book variable inside
program?

Answers were Sorted based on User's Feedback



how to change picture class of copy book variable inside program?..

Answer / sathishkumar

Hi,

Use Replacing option along with COPY.

Copy book(SAMPLE) defined as :

01 COPY REC
05 Emp-no 9(5).
05 name x(5).

If you want to change the Emp-No to 9(6).

Copy SAMPLE Replacing EMp-no by EMP-no1.
Define EMp-no1 as 9(6.

Is This Answer Correct ?    16 Yes 4 No

how to change picture class of copy book variable inside program?..

Answer / sandeep_1985

You need to redefine copybook group variable in program and
then give the new picture clause for that.

I think that is the only way you can do. Correct me if i am
wrong.

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More COBOL Interview Questions

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

9 Answers  


Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?

3 Answers  


What is perform what is varying?

0 Answers  


What is the difference between a binary search and a sequential search?

10 Answers  


1)what is use of linkage section? 2)what is difference between comp and comp-3

1 Answers   Cap Gemini,


Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


What is LENGTH in COBOL II?

2 Answers   CSC,


What is SET TO TRUE all about, anyway?

5 Answers  


What are subroutines ? and how do we pass data to the sub routines?

2 Answers   Xansa,


consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

5 Answers   TCS,


how can u redefine picx(10) with pic 9(6).

3 Answers   TCS,


wht is structured cobol pgm and non structred cobol pgm ?

1 Answers   CTS, DELL,


Categories