Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Program abends with SOC4 while reading the 231st record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Reshmi

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Thu Apr 10, 2008 3:42 pm    Post subject: Program abends with SOC4 while reading the 231st record
Reply with quote

Hi all,

We need a program that will be able to take input file of any length and extract only specific data from it. This means if today we execute the program with length of 300, next day we may execute it with an input file of length 400.

For this we declared the input file to have size 10000 (the max possible size of any file in our system) in FD section. In this way program takes file of any record length.

Now we see that when we give an input file of length 440, the program abends with SOC4 while reading the 231st record. So just for debugging purpose we increased the file length in FD section to 10440(10000+ input file length), and then we see that program abends upon reading 230th record. We have confirmed that it is not because of data error.

Could someone please provide us with some solution for this.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Apr 10, 2008 3:54 pm    Post subject: Strange SOC4!!! Please help....
Reply with quote

Is the file defined as VARIABLE LENGTH in the program and is the file truly Variable Length?

Judging by what you've posted, the answer to both of these questions is YES!

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

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Thu Apr 10, 2008 4:01 pm    Post subject:
Reply with quote

Thanks for the response.

The input file format will always be FB,only the record length (LRECL) will change.

So the file is not defined as variable length and it will not be of variable length.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Apr 10, 2008 4:10 pm    Post subject:
Reply with quote

I presume this is the problem with the Blockzise of the file.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Apr 10, 2008 4:18 pm    Post subject: Reply to: Strange SOC4!!! Please help....
Reply with quote

Suppose if u have specified 10000 as record length in ur cobol program
and if u give 440/anyother other than 10000 than u will get File-status 39 "File Attributes Mismatch".
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Thu Apr 10, 2008 4:25 pm    Post subject:
Reply with quote

Are you specifying RECORD CONTAINS 0 CHARACTERS in FD entry?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Thu Apr 10, 2008 4:33 pm    Post subject: Re: Reply to: Strange SOC4!!! Please help....
Reply with quote

sri_mf wrote:
Suppose if u have specified 10000 as record length in ur cobol program
and if u give 440/anyother other than 10000 than u will get File-status 39 "File Attributes Mismatch".


Not if RECORD CONTAINS 0 CHARACTERS specified in FD entry. Program will accept input file with any length. If the record struct in program is shorter than actual, then record will be truncated. If it is greater then only the area = record length can be addressed. If tried to access area beyond then Addressing exceptions (s0c4 etc.) may be encountered.
This may be happening with OP, just a guess..
Back to top
View user's profile Send private message
Reshmi

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Thu Apr 10, 2008 4:51 pm    Post subject:
Reply with quote

Yes , we are specifying "RECORD CONTAINS 0 CHARACTERS" in FD entry.
Record struct in program is greater than actual.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Apr 10, 2008 4:55 pm    Post subject: Re: Reply to: Strange SOC4!!! Please help....
Reply with quote

agkshirsagar wrote:
sri_mf wrote:
Suppose if u have specified 10000 as record length in ur cobol program
and if u give 440/anyother other than 10000 than u will get File-status 39 "File Attributes Mismatch".


Not if RECORD CONTAINS 0 CHARACTERS specified in FD entry. Program will accept input file with any length. If the record struct in program is shorter than actual, then record will be truncated. If it is greater then only the area = record length can be addressed. If tried to access area beyond then Addressing exceptions (s0c4 etc.) may be encountered.
This may be happening with OP, just a guess..


Thanks abhijit for correcting me.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Thu Apr 10, 2008 5:07 pm    Post subject:
Reply with quote

Reshmi,
Did you check for the possibility that you may be referring memory beyond the record size?
Back to top
View user's profile Send private message
Reshmi

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Thu Apr 10, 2008 5:23 pm    Post subject:
Reply with quote

Record length of our input file is 440 and we are reading this in to record struct of X(10000).
Can you please tell us how to check if it is referring beyond the record size
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 10, 2008 9:36 pm    Post subject:
Reply with quote

Odds are that is is failing with the last record in the block....
Simplest solution, is define the file 'undefined' and unblocked, read the block as an undefined record and start extracting each currently defined (for this run) record out of the undifined block.....
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Apr 10, 2008 10:10 pm    Post subject: Re: Strange SOC4!!! Please help....
Reply with quote

If you create and read the file as a true variable-length, specify the following in your FD -
Code:

RECORD IS VARYING IN SIZE FROM nnnnn TO nnnnn CHARACTERS DEPENDING ON WS-RECORD-LGTH.

With the first series of nnnnn representing the minimum-length and the second series of nnnnn representing the maximum-length.

Then, in WS, specify -
Code:

03  WS-RECORD-LGTH PIC  9(08) BINARY.

Note that WS-RECORD-LGTH must be UNSIGNED (as illustrated). My own preference is a binary-fullword, but a 9(05) PACKED-DECIMAL or 9(05) DISPLAY will also work.

Your COBOL version/release must be COBOL2 or greater.

Regards,

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

Site Director


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

PostPosted: Fri Apr 11, 2008 12:22 am    Post subject:
Reply with quote

Hello,

What is the blksize for your file? How many records are in the file?

What happens if you run a test where the FD specifies the exact record length?

Does this program have an internal sort? When an nternal sort is ungracefully terminated, an 0c4 often results.
Back to top
View user's profile Send private message
Reshmi

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Mon Apr 14, 2008 8:10 am    Post subject:
Reply with quote

The input file has about 999 records.
when we ran a test version with FD specifying exact record length, the program runs fine with no abends.

The program does not have any internal sort.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Apr 14, 2008 8:28 am    Post subject:
Reply with quote

Hello,

Please post the SELECT and FD from the cobol program.

Also, please post the dataset information from tso/ispf 3.4.

If it is available, please post the jcl from the process that creates the file.
Back to top
View user's profile Send private message
Reshmi

New User


Joined: 06 Oct 2005
Posts: 9

PostPosted: Tue Apr 15, 2008 1:27 pm    Post subject:
Reply with quote

SELECT clause from COBOL program:
---------------------------------------------
SELECT INPUT-FILE
ASSIGN TO UT-S-INPFILE1
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FILE-STATUS.

FD from COBOL program
-----------------------------
FD INPUT-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
RECORD CONTAINS 0 CHARACTERS
LABEL RECORDS ARE STANDARD.
01 INPUT-REC PIC X(10000).

Input dataset information from 3.4
-----------------------------------------
General Data
Management class . . :DEVL
Storage class . . . : BASE
Volume serial . . . : DP3050 +
Device type . . . . : 3390
Data class . . . . . : **None**
Organization . . . : PS
Record format . . . : FB
Record length . . . : 440
Block size . . . . : 27720
1st extent cylinders: 1
Secondary cylinders : 1

Sorry, the JCL that creates the file is not available.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Tue Apr 15, 2008 11:42 pm    Post subject:
Reply with quote

Hello,

As an experiment, could you change the input record definition from
Code:
01 INPUT-REC PIC X(10000).
to
Code:
01 INPUT-REC PIC X(30000).
?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Apr 15, 2008 11:58 pm    Post subject:
Reply with quote

Since you are using COBOL in a manner that it is not designed for you should expect to run into problems like this.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 16, 2008 12:17 am    Post subject:
Reply with quote

Craq Giegerich wrote:
Since you are using COBOL in a manner that it is not designed for you should expect to run into problems like this.
Sorry to disagree, but the manual does say that RECORD CONTAINS 0 is valid and the actual record size is taken from the DD statement parameters.
If this length could change each run, then the DD reclen value would have to change with it. A SET variable would work nice and could also be passed down to the program via parm for a read into a ws ODO area set by that same size.....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us