View previous topic :: View next topic
|
Author |
Message |
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
Hi,
I have a table field say
PB-LMT(2,3) PIC S9(07)V99 COMP-3.
I want to display its value in sysout for testing purpose. I tried to MOVE it in a working storage variable declared as
WS-PB-LMT1 PIC Z(07)V9(2). but getting SOC4 error
Can anyone pls help me on it.
Thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
1. Why not just display the table element with the leading zeroes?
2. An S0C4 ABEND is a storage violation -- meaning you are going outside your table bounds or otherwise attempting to use storage that is not assigned to your program. Without specific code, there's not much more we can say.
3. You posted invalid syntax -- what is this supposed to be?
Quote: |
PB-LMT(2,3) PIC S9(07)V99 COMP-3. |
|
|
Back to top |
|
|
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
Thanks Robert for quick!
In Copybook the field PB-LMT is declared as below.
Code: |
10 PB-ACCUM-G.
15 PB-LMT-E OCCURS 32 TIMES
INDEXED BY PB-LMT-IDX.
20 PB-LMT OCCURS 3 TIMES
PIC S9(07)V99 COMP-3. |
And the VSAM file from which I am reading is in compressed format, so I'm not able to view the field values in FILE-AID.
I want to see the value of PB-LMT(2,3). So I need this value in sysout.
I tried to display other table variable value also with simple display statement after reading VSAM file. Like -
DISPLAY '__________________________________'
DISPLAY 'PB-LMT(2, 1) : ' PB-LMT(2, 1)
DISPLAY 'PB-LMT(2, 2) : ' PB-LMT(2, 2)
DISPLAY 'PB-LMT(2, 3) : ' PB-LMT(2, 3)
DISPLAY '__________________________________'
But, it's not reflecting correct value. Below os sysout result -
__________________________________
PB-LMT(2, 1) : 0079600 0
PB-LMT(2, 2) : 110000000
PB-LMT(2, 3) : 0 0000000
__________________________________
Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Is the PB-LMT field in a 2-dimensional array?
It looks like your index(es)/subscript(s) are wrong (outside of the array) when you try to move the value to the WS field. . . You could try using SSRANGE to see when the error happens. |
|
Back to top |
|
|
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
Yes, Dick It's in 2 dimensional array. |
|
Back to top |
|
|
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
I did try with SSRANGE before ID DIV but getting SOC4 again.
CBL SSRANGE
IDENTIFICATION DIVISION.
************************* |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Your post has been "Code'd" to improve readabiliby.
What about an index for the second array?
How did you get from the 0c4 to incorrect results?
It sounds like there multiple things wrong and rather than actually fixing one problem at a time, a shotgun approach is being taken. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Follow on:
Which instruction causes the 0c4? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
looks like the 2 dimensional table within the vsam record is corrupted,
typical reason: program updating the record is not properly written -
different record definition
different working-storage definition
Looks like you have a short record. DFSORT can validate your record lengths.
and why are you not using the work-area option on your reads?
any module that references the record should be checked.
are there different record types within the vsam file?
did not know that file-aid could not handle a compressed vsam record. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
if you require an extra dd parm to read/write the file,
maybe some update job is not using the required parm. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
last but not least,
Dick asked the most important question,
when/where are you getting the soc4?
you are not getting it on 2,3.
between no answer on the soc4 and this silliness about file-aid,
i am afraid we have wasted a lot of time here, |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
As has been pointed out, there is much that doesn't add up.
If you can display the ( 2 3 ) without getting a S0C4, then you won't get a S0C4 on the MOVE with the same data.
SSRANGE you have, but with literal subscripts you know they are inside the range.
So,
Show your JCL for the VSAM file
Show the Select from your program
Show the FD and what is subordinate to it
If not shown in the previous, show the full copybook
If you are accessing ( 2 3 ) for a record which only has one entry in the table then sometimes you'll get output with no abend, sometimes you'll get S0C7, and you have a chance of S0C4 as well. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
Just a side note - if you are going to move it to a display field, why not show the sign and the actual (rather than implied) decimal point? |
|
Back to top |
|
|
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
I did try with SSRANGE before ID DIV but getting SOC4 again.
CBL SSRANGE
IDENTIFICATION DIVISION.
************************* |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, but I said that SSRANGE is not going to change anything. You are using literal subscripts which are known to be within the range.
Can you provide what has been requested, else it is difficult to say much more? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The S0C4 means your program is attempting to access (read or write) storage which does not belong to your program. There is a good chance this is due to a subscript being out of range (a bad variable value, for example, when the variable is being used for a subscript). However, there is also a good chance that the storage violation has absolutely nothing to do with your table.
The abend messages should include a program name and offset into that program where the problem was identified (note that for S0C4 abends in particular, the location the problem is identified at could be a long way from where the storage violation actually occurred). Using that offset to identify the line of code would be the first step to figuring out the abend. |
|
Back to top |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
Why not a simple Repro of some records to Sysout to verify the contents to start with? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
And the VSAM file from which I am reading is in compressed format, so I'm not able to view the field values in FILE-AID. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
As i asked before, which instruction caused the 0c4?
I suspect it may be due to referencing a closed (or not yet opened) file. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
looks like the topic is going down the sink
up to now the TS has not posted a single bit of info useful to solve his problem |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Enrico,
Yup, but some of us "big kids" are having fun tossing out ideas
d |
|
Back to top |
|
|
Ravi Kirti
New User
Joined: 24 Mar 2012 Posts: 17 Location: pune
|
|
|
|
Sorry for late response, I was away for some time.
The storage reference exception occurred in the following statement:
MOVE PB-LMT(2,3) TO WS-PB-LMT1
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, if that is all you are going to give us, then Dick's "file not currently open" is the most likely, followed by only one entry on that particular record.
We can keep guessing 'til the cows come ho... Oh, there they are now. 'nuff guessing. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Where is PB-LMT located (in the FD, working-storage, linkage section)?
If it is in the FD, you have probably already been given the answer. . . |
|
Back to top |
|
|
|