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

SOC 4 Abend at 516th Record


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

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Nov 10, 2010 4:26 am
Reply with quote

Hi
I am getting a SOC4 abend when I try to move the 516th record to a Working Storage variable.

I ahve the program compiled with 'NODYNAM,DATA(31) Option. I have the 'REGION=0M' specified on my JobCard. I have tried all possible options in order to avoid this error. There is no problem with the file I have checked and validated it.

One point that I notice is that it reads and displays every record properly in the spool. But when it reads and Displays the 516th record it displays only the first 102 bytes of the 213 bytes. Not sure why.

Below is the error log from the job

Code:
IEA995I SYMPTOM DUMP OUTPUT  127                         
  USER COMPLETION CODE=4039 REASON CODE=00000000         
 TIME=15.43.23  SEQ=16944  CPU=0000  ASID=0295           
 PSW AT TIME OF ERROR  078D1000   88281CB2  ILC 2  INTC 0D
   NO ACTIVE MODULE FOUND                                 
   NAME=UNKNOWN                                           
   DATA AT PSW  08281CAC - 00181610  0A0D58D0  D00498EC   
   AR/GR 0: A55BB58A/84000000   1: 00000000/84000FC7     
         2: 00000000/00028078   3: 00000000/00000004     
         4: 00000000/08276BB0   5: 00000000/00027C0C     
         6: 00000000/00000000   7: 00000000/2930B410     
         8: 00000000/00028078   9: 00000000/0002977E     
         A: 00000000/00027C0C   B: 00000000/88281BD8     
         C: 00000000/00021B88   D: 00000000/0002A878     
         E: 00000000/88275D74   F: 00000000/00000000     
 END OF SYMPTOM DUMP                                     
+ABONL-23:  UNABLE TO DETERMINE REPORT DATASET FILE TYPE 


Please let me know of any options that I can use to revert from the problem.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Nov 10, 2010 4:35 am
Reply with quote

why not print ( using idcams for example ) 520 records to se what is going on in the dataset ???
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Nov 10, 2010 4:43 am
Reply with quote

I tried printing all the records and thats the reason I am sure there is nothing wrong in the records.

Infact I tried swapping the records i.e. Moved the first record that processed successfully to 516th record, but it still abended at 516th record.

Just FYI the file is a VB File
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 10, 2010 5:10 am
Reply with quote

You should specify DYNAM as opposed to NODYNAM. This is preferable for Batch but NEVER for CICS.

Are you using the following FD example -
Code:

FD INPUT-FILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS V
RECORD IS VARYING IN SIZE
FROM xxxxx TO yyyyy CHARACTERS
DEPENDING ON WS-INPUT-LGTH
BLOCK CONTAINS 0 RECORDS.
01 INPUT-REC PIC X(yyyyy).

WORKING-STORAGE SECTION.
01  WS-DATA.
    03  WS-INPUT-LGTH PIC  9(08) COMP.
    03  WS-INPUT-REC  PIC  X(yyyyy).

PROCEDURE DIVISION.

READ INPUT-FILE INTO WS-INPUT-REC.

After the READ, WS-INPUT-LGTH will contain the length of the variable-length record which was just read and INPUT-REC AND WS-INPUT-REC must be addressed using reference modification with WS-INPUT-LGTH as the length portion.

WS-INPUT-REC (1:WS-INPUT-LGTH).

A S0C4 is certainly possible if you attempt to address INPUT-REC without using reference modification and (for example) WS-INPUT-LGTH was 100 and you tried to address a position in INPUT-REC beyond position 100.

Note in the example, xxxxx represents the minimum record-length and yyyyy represents the maximum record-length.

Bill
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Nov 10, 2010 5:38 am
Reply with quote

The FD Section is the exact same as what is mentioned

I am getting a SOC-4 when I execute the move as below for 216th record

Code:
MOVE INPUT-REC to WS-INPUT-REC


I feel the problem is somewhere related to the memory overflow or something but I am not very sure or know the resolution.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 10, 2010 5:57 am
Reply with quote

I would suggest using the example I had posted and use reference modification, which was introduced with VS/COBOL II. If you're using OS/VS COBOL, then this won't work.

When you READ a variable-length file and the FD "01" is defined as 213 bytes, but the actual length for a given READ is less than 213 bytes (let's say it's 200), then in your MOVE statement, the underlying Assembler instruction will attempt to move all 213 bytes from INPUT-REC to WS-INPUT-REC. When the instruction attempts to move byte 201 from INPUT-REC to WS-INPUT-REC, you'll get a S0C4 addressability (protection) exception because the storage allocation after the READ for "INPUT-REC" was only 200 bytes and the address for byte 201 and greater is bogus.

I can't explain this any clearer so, it's your call....

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Nov 10, 2010 6:21 am
Reply with quote

Huzefa, it sounds like you've decided what the problem is and want a solution to that problem, whether or not it actually has any bearing upon your actual problem. Having the right attitude is 90% of debugging, and the right attitude is to not decide in advance what the problem is.

What is the file status code for the read of the record you think is having the problem?

What is the VSAM extended file status codes for the read of that record?

If the file is variable length, coding MOVE INPUT-REC TO WS-INPUT-REC is probably the single worst way to move the buffer data to WORKING-STORAGE. You need to either use reference modification to do the move, or you need one 01 level in the FD for each possible length record and move the correct 01 level to WORKING-STORAGE. Even better would be to use READ INTO.

And a protection exception (S0C4) may or may not have anything to do with a file -- it can be caused by different things, some of which have nothing to do with files.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Nov 10, 2010 8:49 am
Reply with quote

Hello,

A couple of thoughts. . .

Is there an array involved?

Does the file have a "depending on some-lth-field"?

What happens if you define a ws variable that is 40,000 bytes and "read into" this rather than using the MOVE?

Quote:
I feel the problem is somewhere related to the memory overflow or something but I am not very sure or know the resolution.
It would be better if you changed feelings. . . Your feeling should be to look for the problem with either the file definition, the file content, or (most likely) the code is wrong. . .
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Nov 10, 2010 9:23 pm
Reply with quote

I tried Reference Modification and it doesn't work.
Below is the code snippet to answer all the questions.

Code:
FD  INPT-FILE                                       
    RECORDING MODE IS V                             
    RECORD IS VARYING IN SIZE                       
              FROM 1 TO 250 CHARACTERS               
              DEPENDING ON INPT-LEN                 
              DATA RECORDS ARE INBOUND-INPT-AREA.   
                                                     
01  INBOUND-INPT-AREA.                               
   05  I-INPT-REC-TYPE                  PIC  9(02). 
   05  I-INPT-REC-DATE                  PIC  9(08). 
   05  FILLER                           PIC  X(240).

01  RECORD-SPACE.                                     
    05  REC-LEN                      PIC S9(04)  COMP.
    05  REC-RETURNED.                                 
        10  REC-TYPE                 PIC  X(02).       
        10  REC-CPCS-DT              PIC  9(08).       
        10  REC-RETRN-BALANCE        PIC  X(240).     

READ INPT-FILE                                           
    AT END                                               
       SET EOF TO TRUE                                   
END-READ                                                 
                                                         
EVALUATE INPT-STAT                                       
    WHEN 00                                               
    WHEN 04                                               
        DISPLAY 'WHEN 0'                                 
        MOVE INPT-LEN          TO REC-LEN                 
        DISPLAY 'INBOUND-RTRN-AREA ' INBOUND-RTRN-AREA   
        MOVE INBOUND-INPT-AREA(1:REC-LEN) TO REC-RETURNED
        DISPLAY 'REC-RETURNED      ' REC-RETURNED         
    WHEN 10   
        SET END-OF-PROCESS     TO TRUE           
    WHEN OTHER                                   
        SET END-OF-PROCESS TO TRUE               
        PERFORM ABEND-PARA
END-EVALUATE


Please let me know if I have missed anything.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Nov 10, 2010 10:26 pm
Reply with quote

Hello,

Quote:
Please let me know if I have missed anything.

Yes - for starters the FD does not match the 2 level-01s.

You didn't use "read into" as suggested.

Where is "inpt-len"?

Where is inpt-stst?

icon_confused.gif
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu Nov 11, 2010 1:14 am
Reply with quote

I have used the following structure and it works.

FD INPUT-FILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS V
RECORD IS VARYING IN SIZE
FROM 20 TO 1500 CHARACTERS
DEPENDING ON WS-INPUT-RECSIZE
BLOCK CONTAINS 0 RECORDS.
01 INPUT-REC-ALL.
05 INPUT-REC-BYTES OCCURS 20 TO 1500
DEPENDING ON WS-INPUT-RECSIZE PIC X(001).

WORKING-STORAGE SECTION.
01 WS-INPUT-RECSIZE PIC 9(08) COMP VALUE ZERO.
01 WS-INPUT-RECORD PIC X(1500) VALUE SPACES.

PROCEDURE DIVISION.

READ INPUT-FILE
AT END
MOVE 'Y' TO INPUT-FILE-EOF.

IF INPUT-FILE-EOF = 'Y'
GO TO Q0000-EXIT.

MOVE INPUT-REC-ALL TO WS-INPUT-RECORD.
Back to top
View user's profile Send private message
PalDesh22

New User


Joined: 11 Nov 2010
Posts: 2
Location: India

PostPosted: Thu Nov 11, 2010 4:39 pm
Reply with quote

Why dont you change the input file to have only 515 records and check if that runs.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Nov 11, 2010 9:54 pm
Reply with quote

Hello and welcome to the forum,

When replying to a topic, it is best to read and understand the posts leading up to the current "last" reply.

Did you read/understand this:
Quote:
Infact I tried swapping the records i.e. Moved the first record that processed successfully to 516th record, but it still abended at 516th record.
The problem does not appear to be related to the content of record 516. . .

If the program runs to end with no abend using only 515, what might be learned?

I suspect the problem progrm is "walkikng on storage" and the problem is not the actual abend, but the processing that occurs before the abend.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Fri Nov 12, 2010 7:47 pm
Reply with quote

Finally!!!

I modified the READ to READ INTo and the program worked like a charm.

Thanks all for your patience and Reply!!!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Nov 12, 2010 8:17 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

Now that it is working, i'd encourage spending some time to learn exactly why there was a problem.

Good luck,

d
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 Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts Sort based on the record type DFSORT/ICETOOL 1
Search our Forums:

Back to Top