Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Regarding Redefined

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
rajeevdas03

New User


Joined: 21 Jan 2006
Posts: 8
Location: Mumbai

PostPosted: Thu Apr 17, 2008 4:59 pm    Post subject: Regarding Redefined
Reply with quote

Hi,

Can I redefined a variable like this.

05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(5).

during compilation it is giving error;
Original item is smaller than redefinition (7 < 8).

in book it is mentioned you can redefine variable like this
Back to top
View user's profile Send private message
References
PostPosted: Thu Apr 17, 2008 4:59 pm    Post subject: Re: Regarding Redefined Reply with quote

kedianirmal

New User


Joined: 08 Feb 2008
Posts: 8
Location: Indian

PostPosted: Thu Apr 17, 2008 5:08 pm    Post subject:
Reply with quote

Hi Rajiv,

X is alphanumeric and 9 is just numeric. This may create problem redefining Alpha-num to Num.

Nirmal
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 903
Location: germany

PostPosted: Thu Apr 17, 2008 5:13 pm    Post subject:
Reply with quote

Rajiv,

Quote:

05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(5).


WS-PCT-ALPHA PIC -9.9(5). is an edit mask - it is alpha 8 char

did you mean

WS-PCT-ALPHA PIC S9V9(5). which is numeric display 7 char

you can redefine anything as long as your redefinition is not larger than the redefine object.
Back to top
View user's profile Send private message
rajeevdas03

New User


Joined: 21 Jan 2006
Posts: 8
Location: Mumbai

PostPosted: Thu Apr 17, 2008 5:14 pm    Post subject: Reply to: Regarding Redefined
Reply with quote

nirmal,

I redefined like this , it is working now.

thaks
Back to top
View user's profile Send private message
rajeevdas03

New User


Joined: 21 Jan 2006
Posts: 8
Location: Mumbai

PostPosted: Thu Apr 17, 2008 5:17 pm    Post subject: Reply to: Regarding Redefined
Reply with quote

sorry nirmal,

like this i redefined.

05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(4).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1