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
 
Redefines question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
gaps030980

New User


Joined: 27 Sep 2005
Posts: 6
Location: Gurgaon

PostPosted: Mon Aug 25, 2008 9:43 am    Post subject: Redefines question
Reply with quote

What will happen if a variable is declared as below..
Explain with an example?

Working storage section:-
01 WS-VARX PIC X(9) VALUE SPACES.
01 WS-VARN REDEFINES WS-VARX PIC 9(9).
Back to top
View user's profile Send private message
References
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 103
Location: bangalore

PostPosted: Mon Aug 25, 2008 9:47 am    Post subject: Reply to: Redefines question
Reply with quote

hi,

did you try writing a small program & test ??

let the forum know ....... if you find anything interesting!

Time to experiment icon_idea.gif
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

PostPosted: Mon Aug 25, 2008 10:31 am    Post subject: Re: Redefines question
Reply with quote

gaps030980 wrote:
What will happen if a variable is declared as below..
Explain with an example?

Working storage section:-
01 WS-VARX PIC X(9) VALUE SPACES.
01 WS-VARN REDEFINES WS-VARX PIC 9(9).


Similar posts you can find..Just Search ...
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2241
Location: Mumbai, India

PostPosted: Mon Aug 25, 2008 10:37 am    Post subject: Re: Redefines question
Reply with quote

Hi,
gaps030980 wrote:
Explain with an example?
I re-read it many times, any how it doesn't look like a request, oh..I'm being just tested I think, No prblems, let's go ahead..tests turn me on.. icon_smile.gif.

Check these links and post us back if you don't find out what you are looking for, please post back after a lil labour from your side.. icon_smile.gif

http://www.ibmmainframes.com/viewtopic.php?t=24349&highlight=redefines
http://www.ibmmainframes.com/viewtopic.php?t=31503&highlight=redefines
http://www.ibmmainframes.com/viewtopic.php?t=29175&highlight=redefines
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2241
Location: Mumbai, India

PostPosted: Mon Aug 25, 2008 10:38 am    Post subject:
Reply with quote

Hello again,

BTW, what do you think what should happen, when you say -
Quote:
What will happen if a variable is declared as below..
does something strange happen at your end ?
Back to top
View user's profile Send private message
gaps030980

New User


Joined: 27 Sep 2005
Posts: 6
Location: Gurgaon

PostPosted: Mon Aug 25, 2008 12:08 pm    Post subject:
Reply with quote

I am getting a SOC-7. I tried. Guess because I am moving non -numeric data to num field.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1184
Location: Chennai - India

PostPosted: Mon Aug 25, 2008 12:24 pm    Post subject: Reply to: Redefines question
Reply with quote

Quote:
am getting a SOC-7. I tried. Guess because I am moving non -numeric data to num field.


Moving alone will not cause SOC-7 . It would abend with SOC7 only when you do arithmetic operations on a numeric field populated with non-numeric data . If am not wrong, this was once posted in this forum.
Back to top
View user's profile Send private message
vv

New User


Joined: 06 Jan 2008
Posts: 11
Location: bangalore

PostPosted: Mon Aug 25, 2008 4:35 pm    Post subject:
Reply with quote

initially 9(9( value will be allocated after that any spaces will be allocated
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2241
Location: Mumbai, India

PostPosted: Mon Aug 25, 2008 4:41 pm    Post subject:
Reply with quote

I think some words are is stuk-up there in your key board, please complete the sentence..
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8771
Location: 221 B Baker St

PostPosted: Mon Aug 25, 2008 8:52 pm    Post subject:
Reply with quote

Hello,

Quote:
I am getting a SOC-7. I tried. Guess because I am moving non -numeric data to num field.
A redefines will not cause an 0c7.

Invalid numeric data will.

Simply redefining an "x" field as a "9" field does not make the content numeric. You must validate and/or correct the data before you use it.

Quote:
initially 9(9( value will be allocated after that any spaces will be allocated
This needs clarification. . .
Back to top
View user's profile Send private message
John K

New User


Joined: 27 Aug 2008
Posts: 3
Location: St. Louis, MO

PostPosted: Wed Aug 27, 2008 9:16 pm    Post subject: Reply to: Redefines question
Reply with quote

You'll find you get the most effective help if you explain what are you trying to accomplish. At this point one can only guess.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1