Facing S0C4 abend



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: Facing S0C4 abend

Postby sriraj1122 » Tue Mar 01, 2011 7:03 pm

Hi Zio,

Yes I got below warning during compilation of main program and sub program.

MESSAGE NUMBER SEVERITY LINE NUMBER MESSAGE
DFH7038I W 14 SEQUENCE ERRORS IN SOURCE PROGRAM.

Im trying to run with the code snippet u have provided.

Regards,
Sriraj
sriraj1122
 
Posts: 19
Joined: Thu Nov 18, 2010 10:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Facing S0C4 abend

Postby sriraj1122 » Tue Mar 01, 2011 7:22 pm

Hi Steve,
Here is the control card for LINKEDIT

P1//LKED EXEC PGM=IEWL,PARM='LIST,XREF,LET,REUS,AMODE=31,RMODE=ANY',
P1// COND=&CONDLNK
P1-- COND=(4,LT,COMPILE)


Regards,
Sriraj K
sriraj1122
 
Posts: 19
Joined: Thu Nov 18, 2010 10:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Facing S0C4 abend

Postby NicC » Wed Mar 02, 2011 12:29 am

That is the JCL for the linkedit - or some of it. It is not the control cards.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Facing S0C4 abend

Postby Robert Sample » Wed Mar 02, 2011 1:54 am

sriraj: I just tested your original code and it works fine -- so your S0C4 must due to your linkage editor / binding process. Your subprogram linkage editor output should look something like:
1                         *** M O D U L E  M A P ***

 ---------------
 CLASS  B_TEXT            LENGTH =     1200  ATTRIBUTES = CAT,   LOAD, RMODE=ANY
                          OFFSET =        0 IN SEGMENT 001       ALIGN = DBLWORD
 ---------------

  SECTION    CLASS                                      ------- SOURCE --------
   OFFSET   OFFSET  NAME                TYPE    LENGTH  DDNAME   SEQ  MEMBER

                 0  CALLS1             CSECT       5AC  SYSLIN    01  **NULL**
and your main program linkage editor output should look something like:
 IEW2322I 1220  1     INCLUDE SYSLIB(CALLS1)
 IEW2322I 1220  2     ENTRY MF0167C
 IEW2322I 1220  3     NAME MF0167C(R)

1                         *** M O D U L E  M A P ***

 ---------------
 CLASS  B_TEXT            LENGTH =     1918  ATTRIBUTES = CAT,   LOAD, RMODE=ANY
                          OFFSET =        0 IN SEGMENT 001       ALIGN = DBLWORD
 ---------------

  SECTION    CLASS                                      ------- SOURCE --------
   OFFSET   OFFSET  NAME                TYPE    LENGTH  DDNAME   SEQ  MEMBER

                 0  MF0167C            CSECT       718  SYSLIN    01  **NULL**

               718  CALLS1             CSECT       5AC  SYSLIB    02  CALLS1
The INCLUDE, ENTRY, and NAME statements on the calling program linkage editor output are linkage editor / binder commands -- what you posted is useless as it is nothing but JCL and for your program to work correctly, you must have more than what you posted in that step.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Facing S0C4 abend

Postby sriraj1122 » Wed Mar 02, 2011 11:13 am

Hi All,

My prob got resolved.
I removed the CICS translator step in my compile program and the problem got resolved.

But not sure why if thre is a cics translator im encountering this S0C4 abend.

Anyways i really owe a great thanks to you all for ur suggestions.

Regards,
Sriraj K
sriraj1122
 
Posts: 19
Joined: Thu Nov 18, 2010 10:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Facing S0C4 abend

Postby Robert Sample » Wed Mar 02, 2011 3:48 pm

Maybe because CICS changes your program code to always use a linkage section? And a batch main program won't have addressability to the linkage section?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Facing S0C4 abend

Postby BillyBoyo » Wed Mar 02, 2011 6:34 pm

Zio69 wrote:Could it be that by mistake it was pre-compiled for use under CICS??


Good thought Zio69, spot on.

Robert Sample wrote:Maybe because CICS changes your program code to always use a linkage section? And a batch main program won't have addressability to the linkage section?


There was a "main" program, doing a dynamic call (via call variable-name) to the sub-program. Then compile for CICS and run in batch. The sub-program couldn't address the linkage. The main program wouldn't try to use its linkage section, even if one has been made for it by a pre-compiler. Does CICS add mandatory parameters onto the call? I've never used CICS, so I can't say why it doesn't work, but I guess we're not surprised it didn't work :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Facing S0C4 abend

Postby stevexff » Wed Mar 02, 2011 8:25 pm

The CICS translator adds linkage entries for DFHEIBLK and DFHCOMMAREA at the start of the linkage section. So he would have ended up with a subprogam expecting three parameters, not one...

Duh!
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Facing S0C4 abend

Postby BillyBoyo » Wed Mar 02, 2011 9:54 pm

stevexff wrote:The CICS translator adds linkage entries for DFHEIBLK and DFHCOMMAREA at the start of the linkage section. So he would have ended up with a subprogam expecting three parameters, not one...


OK, sorry to continue on this, but extra entries in the linkage section won't actually matter on their own. Does the CICS translator update the USING, by inserting the DFHEIBLK and DFHCOMMAREA in front of anything you have included on the USING? That would get the S0C4, if the translator is not also updating the "call" in the main program. So, if one dataname on the call using and three on the procedure division using, bang.

However, if, just for fun, I put 300 01 levels in the linkage section, but only one on the procedure division using, that will work as long as there is one on the call using.

If sriraj1122 had looked at his DMAP, would have been three BLL's. A big clue that would have been.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Facing S0C4 abend

Postby stevexff » Wed Mar 02, 2011 10:25 pm

Does the CICS translator update the USING, by inserting the DFHEIBLK and DFHCOMMAREA in front of anything you have included on the USING?
It certainly does. Clever, huh?
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post