Page 2 of 3

Re: Facing S0C4 abend

PostPosted: Tue Mar 01, 2011 7:03 pm
by sriraj1122
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

Re: Facing S0C4 abend

PostPosted: Tue Mar 01, 2011 7:22 pm
by sriraj1122
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

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 12:29 am
by NicC
That is the JCL for the linkedit - or some of it. It is not the control cards.

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 1:54 am
by Robert Sample
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.

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 11:13 am
by sriraj1122
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

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 3:48 pm
by Robert Sample
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?

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 6:34 pm
by BillyBoyo
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 :-)

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 8:25 pm
by stevexff
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!

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 9:54 pm
by BillyBoyo
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.

Re: Facing S0C4 abend

PostPosted: Wed Mar 02, 2011 10:25 pm
by stevexff
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?