View previous topic :: View next topic |
Author |
Message |
baskkarsubbian Beginner
Joined: 31 Aug 2003 Posts: 18 Topics: 12
|
Posted: Sun Sep 07, 2003 12:58 am Post subject: Reference modificatiom |
|
|
Hi
Can we use reference modificatin in the receiving field?
such as move 'abc' to ws-var(2 : 3).
If it is possible then what happens if the length of ws-var is only 4 such as
ws-var pic x(4).
one more doubt in Next sentence. If we code anything after next sentence is it be executed?
If c > 10
Display "....."
Next sentence
Display "00000"
else
Display "///////".
In the above case if c value 12 what will be displayed to the terminal? |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Sun Sep 07, 2003 1:07 pm Post subject: |
|
|
I don't see why these questions are in the JCL Forum.
Anyway, why don't you just try these things out and see what happens? I guarantee you'll learn more that way. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sun Sep 07, 2003 9:22 pm Post subject: |
|
|
OK bask,
This ia a 2 for 1 sale:
1) The 1st char of ws-var will remain unchanged.
2) The "next sent" stmt will not execute anymore than it would if "next sent" were "go to label-a", you may get a compiler error.
Now, you tell ME:
What happens when you "move 'abc' to ws-var(1 : 3)"?
Regards, Jack. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Sep 08, 2003 6:19 am Post subject: |
|
|
baskkarsubbian,
Please post in the approriate forum. I moved this topic from JCL to Application programming forum.
NEXT SENTENCE transfers control to the first statement following the closest separator period.
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
baskkarsubbian Beginner
Joined: 31 Aug 2003 Posts: 18 Topics: 12
|
Posted: Mon Sep 08, 2003 8:38 am Post subject: |
|
|
Sorry for posting in wrong forum.
What happens If ws-var pic x(3).
What happens to the last char? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Sep 08, 2003 9:05 am Post subject: |
|
|
baskkarsubbian,
The last character gets truncated.
I sincerely hope we don't have another mcmillan here.
Kolusu |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Mon Sep 08, 2003 9:54 am Post subject: |
|
|
who is Mcmillan in this context?
Regards,
Manas |
|
Back to top |
|
|
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Fri Nov 14, 2003 10:34 pm Post subject: |
|
|
Kolusu -->> I suspect that if the reference modification is beyond the range of the recieving field, then it will result in corruption of the storage after the recieving field. You could try this and see.
I have had to debug some very nasty abends due to people not doing range checking in thier code.
All the shops I've worked in set the SSRANGE option to OFF for performance reasons.
These types of errors are some of the most challenging problems to solve because the results are totally unpredictable. The impact is dependant upon what storage gets corrupted , how and when it is later referenced.
Very Nasty Bugs.. _________________ Chuck Haatvedt
email --> clastnameatcharterdotnet
(replace lastname, at, dot with appropriate
characters) |
|
Back to top |
|
|
RobertL Beginner
Joined: 18 Nov 2003 Posts: 22 Topics: 0 Location: Lisbon, Portugal
|
Posted: Wed Nov 19, 2003 8:43 am Post subject: |
|
|
Quote: |
I suspect that if the reference modification is beyond the range of the recieving field, then it will result in corruption of the storage after the recieving field. You could try this and see.
|
This is, in fact, what happens. Storage beyond the end of the receiving field is overlaid.
Regards,
Robert |
|
Back to top |
|
|
|
|