IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding Redefined


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajeevdas03
Warnings : 1

New User


Joined: 21 Jan 2006
Posts: 19
Location: Mumbai

PostPosted: Thu Apr 17, 2008 4:59 pm
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
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Thu Apr 17, 2008 5:08 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 17, 2008 5:13 pm
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
Warnings : 1

New User


Joined: 21 Jan 2006
Posts: 19
Location: Mumbai

PostPosted: Thu Apr 17, 2008 5:14 pm
Reply with quote

nirmal,

I redefined like this , it is working now.

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

New User


Joined: 21 Jan 2006
Posts: 19
Location: Mumbai

PostPosted: Thu Apr 17, 2008 5:17 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Selecting a redefined record layout i... Compuware & Other Tools 1
No new posts OUTREC S0C7 issue for particular scen... DFSORT/ICETOOL 6
No new posts Renaming redefined item COBOL Programming 7
No new posts Redefine - Moves between redefining i... COBOL Programming 19
No new posts Problem with numeric variable redefin... COBOL Programming 14
Search our Forums:

Back to Top