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
 

 

mismatch of LRECL in cobol program and jcl.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
nitya
Warnings : 2

New User


Joined: 09 Dec 2005
Posts: 17
Location: Tirupathi

PostPosted: Wed Feb 07, 2007 6:02 pm    Post subject: mismatch of LRECL in cobol program and jcl.
Reply with quote

You are creating a output file throuch a COBOL programme. The Record length mentioned in the DCB parameter of
the JCL is (LCREL=100) and the record layout mentioned in the FILE SECTION of the DATA DIVISION is 01 WS-FILE-REC PIC X(120).

a) The compilation of the programme will give an error
b) Error will be encountered during the run time.
c) No errors will occur but a file of record length 100 bytes will be created
d) A file of record length 120 bytes will be created

can anyone explain wt will happen??

Regards
Nitya.
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Wed Feb 07, 2007 6:29 pm    Post subject:
Reply with quote

The compiler knows nothing about the actual datasets that will be referenced by the running program. That connection is made via the run JCL's ddnames, so the compiler cannot tell you.

All systems I've worked on issue a run-time error when the OPEN is executed.
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: Wed Feb 07, 2007 8:49 pm    Post subject:
Reply with quote

Yup,

I'd bet on the 013-20 abend.

Maybe we can get a moderator to move this to the "interview questions" forum . . . .
Back to top
View user's profile Send private message
Shanu.sukoor

New User


Joined: 31 Jan 2006
Posts: 32
Location: India

PostPosted: Thu Feb 08, 2007 2:58 am    Post subject:
Reply with quote

definitely it will throw an ABEND.
Back to top
View user's profile Send private message
udaybarath

New User


Joined: 10 May 2005
Posts: 7

PostPosted: Fri Feb 09, 2007 10:29 am    Post subject:
Reply with quote

The compliation of the program doesnot relate to any JCl. so ofcourse it wont give any compliation error.
But it will give run time error with an abend of file status 39.

Correct me if i am wrong?

Thanks and regards,
Uday.
Back to top
View user's profile Send private message
bajibabu

New User


Joined: 01 Aug 2005
Posts: 5
Location: hyderabad

PostPosted: Fri Feb 09, 2007 11:11 am    Post subject: Re: mismatch of LRECL in cobol program and jcl.
Reply with quote

Hi,
Ans for this Q is b) Error will be encountered during the run time.

Thanks
Bajibabu
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Fri Feb 09, 2007 5:39 pm    Post subject:
Reply with quote

Hi All,
Everybody has given the correct ans. , Yes the system would throw an abend , U would get a SOC4, reason being Addressablity mismatch, and the pgm would abend when it encounters a open st. , the file status would be 48


Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Fri Feb 09, 2007 7:35 pm    Post subject:
Reply with quote

Your JOB definetly ABEND if you are compiling in Enterprise COBOL. That could be Record length mismatch.

I am not sure about other old COBOL versions.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Fri Feb 09, 2007 7:41 pm    Post subject:
Reply with quote

That will give a record length mis match error at run time
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Feb 10, 2007 4:45 am    Post subject:
Reply with quote

BTW, a pgm doesn't ABEND when you use file status for the file. YOU have to abend it if you desire it.

In this case you should get an OPEN error (abend or RC depending on whether you specify file stat or not).
Back to top
View user's profile Send private message
Pete Eagleton

New User


Joined: 14 Feb 2007
Posts: 11
Location: Chicago

PostPosted: Fri Feb 16, 2007 12:07 am    Post subject: Re: mismatch of LRECL in cobol program and jcl.
Reply with quote

If you test the 'file status' field you can control if the program should abend. I have many programs that read different LRECL files from one DD by doing an open and then testing for a file status of 39. if I get a 39, I close that FD and open it under another FD in the program and so on.(I know that I could possibly read up to X different LRECL files fo I code an FD for each.) used to be a time when you could do a nagative subscribt on the record (start of record minus 4) and get the record length in COBOL.
Back to top
View user's profile Send private message
trgk03

New User


Joined: 20 Jan 2006
Posts: 12
Location: kochi

PostPosted: Fri Feb 16, 2007 10:29 am    Post subject:
Reply with quote

It will give a s806 abend saying A file attribute mismatch was detected.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Fri Feb 16, 2007 10:45 am    Post subject:
Reply with quote

trgk03,
Do u Know watz a S806 Abend is ????????????
Please check your JCL manuals.

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Fri Feb 23, 2007 3:22 pm    Post subject:
Reply with quote

you get file status 39
check it
from-sachin borase
pune
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 Feb 23, 2007 8:39 pm    Post subject:
Reply with quote

Hello,

Yes, if you check for it in the code you can work with the "status 39" causing a "user abend" or setting "return-code".

If you do not check the status in the program, you will get an "open error" which is an s013, not an s806.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Sat Feb 24, 2007 2:59 pm    Post subject:
Reply with quote

Dick,
S013 would be member not found as per my knowledge, I had a similar situation at my work place where the lrecl of the physical file and logical file were not matching for which i had a S0c4 ,as i was trying to reach an address that was not available, in the physical file, I checked the SYSOUT in SPOOL it gave me a 39 FS , so it would be more prompt to say that a S0c4 would come insd of a S013, please correct me if i am wrong.

Thamilzan.
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: Sun Feb 25, 2007 12:48 am    Post subject:
Reply with quote

Hi Thamilzan,

Quote:
please correct me if i am wrong


I believe this is the case. Please look in the system completion codes documentation for the entire definition of an 0c4 and an 013. Some of it is pasted here:

Quote:
013

Explanation: The error occurred during processing of an OPEN macro
instruction. This system completion code is accompanied by message
IEC141I. Refer to the explanation of message IEC141I for complete
information about the task that was ended and for an explanation of
the return code (rc in the message text) in register 15.

and
Quote:
0C4 One of the following exceptions occurred:

4 Protection exception. The key of the storage area
that the running program tries to access is
different from that of the running program. The key
of the running program can be obtained from the PSW
key field. The key of the storage can be obtained
using the IPCS LIST subcommand. The programmer
should determine whether the program is running
with the correct key or whether the storage address
is set up correctly.

10 Segment-translation exception. This error is
| caused by one of the following:

| ? A program that was running disabled attempted
| to reference storage while the page table for
| that storage was paged out. To correct the
| error, page-fix the storage before a program
| running disabled attempts to reference it.

| ? A program attempted to reference storage that
| had not been obtained. To correct the error,
| allocate the storage before attempting to
| reference it.

| ? A program running in a subspace attempted to
| reference storage that was not accessible to
| the subspace at the time of error. To correct
| the error, ensure that the program running in a
| subspace references only the storage assigned
| to that subspace, or storage that can be
| referenced by all subspaces.

11 Page-translation exception. This error is caused
| by one of the following:

| ? A program that was running disabled attempted
| to reference storage while that storage was
| paged out. To correct the error, page-fix the
| storage before a program running disabled
| attempts to reference it.

| ? A program attempted to reference storage that
| had not been obtained. To correct the error,
| allocate the storage before attempting to
| reference it.

| ? A program running in a subspace attempted to
| reference storage that was not accessible to
| the subspace at the time of error. To correct
| the error, ensure that the program running in a
| subspace references only the storage assigned
| to that subspace, or storage that can be
| referenced by all subspaces.




Please note that none of the 0c4 conditions are involved with an OPEN. The 2 most common causes of 0c4 conditions that i encounter are:
1) when one piece of code is trying to communicate with another piece of code and the "handshake" is inconsistent
and
2) when an internal sort is running and the program is terminated while sort is in process. It seems to "lose" itself and does NOT end gracefully.

If you look at the IEC141I message, you will see that
Quote:
IEC141I 013-rc,mod,jjj,sss, ddn[-#] [,dev,ser, dsn]

Explanation: The error occurred during processing of an OPEN macro. This message is accompanied by system completion code 013 with the return code.

18
An OPEN macro instruction was issued for a partitioned data set. The DSNAME parameter specified a member that could not be found.

20
An OPEN macro instruction was issued for a sequential data set using queued access. Either BLKSIZE is not a multiple of LRECL, LRECL=0 when RECFM=FB or FBS, or BLKSIZE is not four bytes greater than LRECL when RECFM=V.


I've included the 013-18 and 013-20 info as they are the 2 of most common open abends encountered by programmers; the -18 caused by a member name typo or the menber not yet created and the -20 because of mis-matched dcb info.

The info pasted above is from the manuals available in the "Manuals" link on this site.

Please let me know if you'd like any other info.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Feb 26, 2007 1:08 pm    Post subject:
Reply with quote

Dick,
Thanks a lot for this explanation, but still please note this point

Quote:
| ? A program attempted to reference storage that
| had not been obtained. To correct the error,
| allocate the storage before attempting to
| reference it.


This is wat makes me to feel that i can be a S0c4, say we have a lrecl=100 for the logical file inside cbl, and in the jcl we had defined the file with lrecl=80, when execution as u had mentioned a HANDSHAKE happens with the logical file and physical file when the mismatch is detected it throws a S0c4, further to this if u r trying to write 100 bytes of data in to a 80 byte file the above quote becomes the absolute truth , trying to reference a memory location that is not available for the system to process (trying to push the extra 20 bytes after writing 80 bytes). But its good to know that it can also be a S013-20 abend.


Thamilzan.
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 Feb 26, 2007 9:02 pm    Post subject:
Reply with quote

Hello,

You do not yet understand - it is not that an open error can also be an 013 - a dcb mismatch will cause an 013 about 99.999% of the time.

I have not yet seen an 0c4 because of inconsistent dcbs alone. If there are other problems with the program, say that some storage has already been walked on, then an open is issued using storage that has already been corrputed by "other problem(s)", an oc4 could occur - but that is not an "open error". That is a problem with other than open code and changing dcb info will not resolve it.

Do you speak assembler? The reference you quoted is for assembler programming and you don't have the opportunity to create that problem when you write COBOL code.

If you look thru the dump you may see that there was one or more errors before the 0c4. If the program is in the middle of an internal sort, and the sort is ungracefully terminated, you may see an 0c4.

But as a rule 013s are open errors (per IBM) and 0c4s are not.

If you'd like any other info, please let us know.
Back to top
View user's profile Send private message
j_sram

New User


Joined: 03 Jul 2006
Posts: 6

PostPosted: Wed Feb 28, 2007 5:30 pm    Post subject:
Reply with quote

program will abend!!!!!
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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