Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 12:18 pm Post subject: SOC4 - Difference between COBOL 39O and Enterprise COBOL
Hello,
My program is given below - When I compile it using COBOL 390 it works even though the subscript reaches -60 , whereas when I compile it in eCobol it abends with SOC4
I've printed out the compile options for both compilers in effect and tried to do a match and they are identical and so are the LE options in effect - What could be the problem?
One wild guess is that the program is getting loaded in the memory is different locations in both cases. But I can't prove it or may be I'm totally clueless
Please suggest.
Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE
DATE-COMPILED.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 W-SUB PIC S9(04) COMP VALUE 0.
01 WS-VARS.
05 LPART-INDEX PIC S9(4) COMP VALUE ZEROS.
05 WS-LAST-PART-LENGTH PIC X(60) VALUE SPACES.
05 WS-TXT-LENGTH PIC X(25) VALUE SPACES.
016800 05 USER-AREA-TXT PIC X(25) VALUE SPACES.
01 T-INTERNAL-TABLE-AREA.
05 INTERNAL-TABLE OCCURS 6 TIMES
ASCENDING KEY IS T-CODE
INDEXED BY CR-INDEX.
10 T-CODE PIC X(01).
10 T-AMT PIC 9(09).
PROCEDURE DIVISION.
MOVE LOW-VALUES
TO WS-TXT-LENGTH
PERFORM VARYING LPART-INDEX FROM
LENGTH OF WS-TXT-LENGTH BY -1
UNTIL WS-TXT-LENGTH (LPART-INDEX:1) > SPACES
END-PERFORM
DISPLAY 'LPART-INDEX ' LPART-INDEX
MOVE WS-TXT-LENGTH (1:LPART-INDEX) TO
USER-AREA-TXT (1:LPART-INDEX).
STOP RUN.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Oct 17, 2006 1:10 pm Post subject:
Quote:
I've printed out the compile options for both compilers in effect and tried to do a match and they are identical and so are the LE options in effect - What could be the problem?
Coolman,
start reading this topic from here and see if all the LE options are the same.
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 1:14 pm Post subject:
Kolusu,
I've already seen this post earlier - In this case, the situation is not between test and prod as in the illustrated post - Both of them are run in the identical region with the same LE libs - The only change I do the JCL is to change the STEPLIB for IGYCRCTL from COBOL390 lib to eCobol lib. That's it. This causes the abend.
________
herbal vaporizers
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 1:28 pm Post subject:
Kolusu,
No, It did NOT - BTW, If you have looked at the procedure division, no table is being used -So, why should I use SSRANGE here - That table in the working storage was one of my old programs (as you can see, I dont' use it in the procedure division) - All it does is referential subscripting, should I use SSRANGE for that too?
________
vaporgenie
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Oct 17, 2006 1:33 pm Post subject:
coolman,
Yes you need the SSRANGE parm. read the following
Code:
SSRANGE specifies that the generated code is to check to ensure
that:
-the effective address generated for an index or subscript
does not reference an area outside the region of the
associated table
-the current effective length for a variable-length item
(i.e., OCCURS DEPENDING ON) is no greater than its maximum
defined length
-for reference modification expressions:
-the reference modification starting position is no
less than 1 and no greater than the current length
of the subject item
-the reference modification length value (if
specified) is no less than 1
-the reference modification starting position and
length value (if specified) do not reference an
area that extends beyond the end of the subject
item
If an "out of range" condition is detected, an error message
will be written to write-to-programmer route code 11 (i.e.,
usually the SYSPRINT dd statement) and the program will be
terminated. When running under CICS, these messages are written
to a temporary storage queue.
The SSRANGE option can result in some performance degradation.
The NOSSRANGE run time option can be specified at run time in
order to inhibit the range checking code generated by specifying
SSRANGE as as a compile time option. In this way, the "dormant"
range checking code can be activated at run time (i.e., to
assist in resolving any unexpected errors) without having to
recompile.
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 1:34 pm Post subject:
Kolusu,
However, I did as you had suggested using SSRANGE even for variable that are not arrays and it works as expected.
For the COBOL/390 compilation - I added CBL SSRANGE and set the CHECK(ON) LE option and it abended with U4038
For the eCOBOL, without me having to set any of these two options, the program is abending with SOC4.
now, without having to change the code, is there a way that I can make the eCobol compiled work just as it's OS/390 counterpart
________
Daihatsu Midget
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Oct 17, 2006 1:52 pm Post subject:
coolman,
Quote:
For the eCOBOL, without me having to set any of these two options, the program is abending with SOC4.
Your shop must have modified default compiler options and added the SSRANGE compiler option as default option. So talk to your system programmers and see if there was a reason for that compiler option
Quote:
now, without having to change the code, is there a way that I can make the eCobol compiled work just as it's OS/390 counterpart
Techincally you are not changing any code in the program , all you are doing is adding the compiler overrides at the top of the program. Even if that is considered as code change then you need to change the compile JCL
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 2:02 pm Post subject:
Kolusu,
I have cut pasted the ecobol compiler options in effect below - How do you say the option SSRANGE was in effect? Also, if it was in effect, the range checking would not be performed if I don't have CHECK(ON) during runtime - Assume, I have everything as you say, I would still get the message below and not S0C4
Quote:
IGZ0072S A reference modification start position value of 0 on line
000025 referenced an area outside the region of data item
WS-TXT-LENGTH.
FYI, I tried coding the parm (NOSSRANGE) for the eCobol compilation even if it's already in effect and as expected, it abended with S0C4. I still feel that it's got to do with the program getting loaded differently
________
launch box vaporizer
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
01 T-INTERNAL-TABLE-AREA.
05 INTERNAL-TABLE OCCURS 6 TIMES
ASCENDING KEY IS T-CODE
INDEXED BY CR-INDEX.
10 T-CODE PIC X(01).
10 T-AMT PIC 9(09).
PROCEDURE DIVISION.
MOVE LOW-VALUES TO WS-TXT-LENGTH
PERFORM VARYING LPART-INDEX FROM
LENGTH OF WS-TXT-LENGTH BY -1
UNTIL WS-TXT-LENGTH (LPART-INDEX:1) > SPACES
END-PERFORM
DISPLAY 'LPART-INDEX ' LPART-INDEX
MOVE WS-TXT-LENGTH (1:LPART-INDEX) TO
USER-AREA-TXT (1:LPART-INDEX).
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 2:29 pm Post subject:
Kolusu,
What does your IGYCRCTL point to? eCobol or OS/390 compiler steplibs? - If it's OS/390, it WOULD work and if it's eCobol it WOULD fail (atleast for me)
In my shop, I point my steplib to below for doing eCobol compiles
Code:
//STEPLIB DD DISP=SHR,DSN=SYS1.IGYECBL.SIGYCOMP
Other than whatever I have shown, there's nothing else in that program. If needed, I can even put the compile JCL. It would be the same as yours except the STEPLIB dataset
________
digital vaporizer
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 2:39 pm Post subject:
Thanks for all the great responses, Kolusu - I guess I have hit a road block and am not sure why it's abending on my system but not yours.
________
VTR1000F
Last edited by coolman on Sat Feb 05, 2011 1:54 am; edited 1 time in total
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Tue Oct 17, 2006 3:09 pm Post subject:
I'm getting a JCL Error as the STEPLIB dataset is not available - It's available at my shop as SYS1.IGY.SIGYCOMP (and contains the COBOL OS/390 compiler)
________
Toyota Liteace
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum