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

Redefines question


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gaps030980

New User


Joined: 27 Sep 2005
Posts: 8
Location: Gurgaon

PostPosted: Mon Aug 25, 2008 9:43 am
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
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Mon Aug 25, 2008 9:47 am
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: 218
Location: India

PostPosted: Mon Aug 25, 2008 10:31 am
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 Dhawan

Superior Member


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

PostPosted: Mon Aug 25, 2008 10:37 am
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

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

Superior Member


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

PostPosted: Mon Aug 25, 2008 10:38 am
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: 8
Location: Gurgaon

PostPosted: Mon Aug 25, 2008 12:08 pm
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: 1287
Location: Chennai, India

PostPosted: Mon Aug 25, 2008 12:24 pm
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: 10
Location: bangalore

PostPosted: Mon Aug 25, 2008 4:35 pm
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 Dhawan

Superior Member


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

PostPosted: Mon Aug 25, 2008 4:41 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 25, 2008 8:52 pm
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
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top