Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding Redefined

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    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

kedianirmal

New User


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

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

Global Moderator


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

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
Warnings : 1

New User


Joined: 21 Jan 2006
Posts: 19
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
Warnings : 1

New User


Joined: 21 Jan 2006
Posts: 19
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Selecting a redefined record layout i... mallik4u Compuware & Other Tools 1 Wed Oct 08, 2014 8:14 am
No new posts OUTREC S0C7 issue for particular scen... Skolusu DFSORT/ICETOOL 6 Fri Mar 07, 2014 1:10 pm
No new posts Renaming redefined item srkumar422 COBOL Programming 7 Tue Oct 19, 2010 3:01 pm
No new posts Redefine - Moves between redefining i... Manish Kumar Gupta COBOL Programming 19 Wed Jun 02, 2010 1:07 am
No new posts Problem with numeric variable redefin... dick scherrer COBOL Programming 14 Thu Nov 26, 2009 9:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us