Skip to Content
Custom Search

Can we redefine a PIC X(100) item to X(200)?

3 replies [Last post]
Anonymous

I have seen this question in many interview dumps? can someone answer that is it possible to redefine a COBOL variable to a larger size?

 

For example:

Can we 

 

10 VAR1 PIC X(100).

10 VAR2 REDEFINES VAR1 PIC X(200).

 

Is the above possible?

Sponsored Listing
DikDude
Offline
Joined: 12/26/2011
Posts:
redefines question

Some versions of some compilers will allow this with no problem.

Some will issue a Warning.

Some will raise an Error and the compile will fail.

Suggest one read the manual for the compiler and version being used.

Anonymous
it is possible

it is possible

Alan.R.Wynne
Offline
Joined: 07/07/2011
Posts:
Redfines
No, you can only redine a longer item with a shorter item, you cannot redefine a short item with a longer item.

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 34 guests online.
Dr. Radut | forum