MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How does this work?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kxsarn
Beginner


Joined: 04 May 2003
Posts: 4
Topics: 3

PostPosted: Sun May 04, 2003 10:40 am    Post subject: How does this work? Reply with quote

Sad I want to know how does this work ? Can any one throw some light?

I have a variable structure declaration like this.

01 var-str1.
05 var1 pic 9(4) comp.
05 var2 pic x(3).
05 var3 pic 9(3) comp-3.

01 var-temp pic x(7).

01 var-str2.
05 var4 pic 9(4) comp.
05 var5 pic x(3).
05 var6 pic 9(3) comp-3.



in Procedure division

move var-str1 to var-temp.
move var-temp to var-str2.

but var-str2 has correct values.
I was of the thought that , for comp-3 and comp fields , only the system bothers about allocating the number of bytes and while moving 9(3) comp-3 to a display variable then it has to be of the type s9(3).

But how the above code works?

Sara
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun May 04, 2003 3:03 pm    Post subject: Reply with quote

Hi Sara,

I'm not sure of what you mean by:
Quote:

...only the system bothers about allocating the number of bytes

When you say:
Quote:

while moving 9(3) comp-3 to a display variable then it has to be of the type s9(3)

do you mean "var-temp"?

Here's what I do know and it might answer all your ques.

All your moves are group moves. A feature of group moves is that NO data conversions are attempted, so its a GIGO scenerio. Whatever your sending field contained will appear in the receiving field, as is, regardless of how the sending/receiving elementary items are defined.

HTH, Jack.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon May 05, 2003 12:19 am    Post subject: Reply with quote

What I understand is that moving data from one variable to another will never cause problem. Problem occurs when you try display/compute that data.

In this case problem will occur if you try to display var-temp, since it will contain non displayable data. Otherwise everything looks okay.

Diba.
Back to top
View user's profile Send private message Send e-mail
Glenn
Beginner


Joined: 23 Mar 2003
Posts: 56
Topics: 3

PostPosted: Mon May 05, 2003 1:32 am    Post subject: Reply with quote

moves of group variables are considered to be X moves, so basically the group variables are defined by default to be X(whatever the size of the group). Nothing is wrong in this code since the size of each group is 7 bytes.
Back to top
View user's profile Send private message
kxsarn
Beginner


Joined: 04 May 2003
Posts: 4
Topics: 3

PostPosted: Mon May 05, 2003 11:05 am    Post subject: Reply with quote

Thanks a lot for all your replies. I got it cleared.

Sara
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group