View previous topic :: View next topic
|
Author |
Message |
nanda31
New User
Joined: 30 Mar 2007 Posts: 8 Location: hyderabad
|
|
|
|
Hi,
I am trying to pass the data from JCL to Cobol program through PARM.
My requirement is to pass +100.00 to a variable having PIC s9(3)v99.
when I am doing that it is giving soc7 abend.
If I change the picture clause of linkage section variable to 9(03) it is working fine.
Can anybody suggest in this regard.
Please keep in mind I have to keep linkage section variable as PIC s9(3)v99. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Without getting into the proper way to pass and recieve data through the linkage section.......
You could pass "10000" to s9(3)v99.
you could pass "+100.00" to X(7) and then COMPUTE (target area) = FUNCTION NUMVAL (passed area) where passed area is the X(7) in the linkage and target area is S9(3)V99 in working storage. If you really need the linakage variable as S9(3)V99, you can redefine the X(7) as the numeric but you will still have to use WS for the numval. |
|
Back to top |
|
|
nanda31
New User
Joined: 30 Mar 2007 Posts: 8 Location: hyderabad
|
|
|
|
Thanks William for the solution...but could u please explain the reason for the abend. is it something because it doesn't take the data in that format?
By the right now I am trying with the second option because it will be easy for a new user also to understand what value is getting passed... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The abend is caused because you gave the program non-numeric data in a field defined to only have numerics. When the code tried to use the invalid data, it raised the s0c7 (data exception) - which says the system took exception to the non-numeric input.
Please refer to the recommendations provided and look them up in your Fine Manual (if you don't have the COBOL manuals, you may access them from this forum.
Please let us know if you have questions. |
|
Back to top |
|
|
|