Re: CEE3SRP/CEEMRCE example in LE C?

2015-02-24 Thread David Crayford
Those pointer indirection hacks don't look right to me. Make sure the LE 
routines are defined to use OS linkage.


#pragma linkage(CEE3SRP,OS)
int CEE3SRP(...)


On 25/02/2015 3:21 AM, Janet Graff wrote:

thank Charles.  I have various other LE calls working but I was off an 
addressing level of the parameters to CEE3SRP and CEEMRCE and a C example would 
have helped tremendously.

I'm pretty sure I have it with:

/* my structure that I want to pass back and forth between main line and abend 
handler */
  struct tokenStruct
  {
 inthandled;
 _INT4  resumePoint;

  };
void badHandler(_FEEDBACK *cond,
 _INT4 *input_token,
 _INT4 *result,
 _FEEDBACK *new_cond)
{
_FEEDBACK fc;
...
struct tokenStruct **tokenStructPtr =
(struct tokenStruct **)input_token;
struct tokenStruct *tokenStruct = *input_token;

/* logic to decide whether to RESUME or not */

*result = 10;/* 10 = RESUME right after CEE3SRP call */
tokenStruct->handled = tokenStruct->handled + 1;
 CEEMRCE(&(tokenStruct->resumePoint), &fc);
}

int main()
{
_FEEDBACK feedback;
struct tokenStruct myTokenStruct;
struct tokenStruct *tokenPtr = &myTokenStruct;
tokenPtr = &myTokenStruct;
_ENTRY pgmptr;

pgmptr.address = (_POINTER)&badHandler;
pgmptr.nesting = NULL;

tokenPtr->handled = 0;
CEE3SRP(&(tokenPtr->resumePoint), &feedback);
CEEHDLR(&pgmptr, &tokenPtr, &feedback);
if (tokenPtr->handled > 0)
{
/* code to handle abend and get this program moving on it's way */
}
/* execute code that abends here */
CEEHDLU(&pgmptr, &feedback);
return 0;
}

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CEE3SRP/CEEMRCE example in LE C?

2015-02-24 Thread Janet Graff
thank Charles.  I have various other LE calls working but I was off an 
addressing level of the parameters to CEE3SRP and CEEMRCE and a C example would 
have helped tremendously.

I'm pretty sure I have it with:

/* my structure that I want to pass back and forth between main line and abend 
handler */
 struct tokenStruct  
 {   
inthandled;  
_INT4  resumePoint;  

 };  
void badHandler(_FEEDBACK *cond,  
_INT4 *input_token,   
_INT4 *result,
_FEEDBACK *new_cond)  
{ 
   _FEEDBACK fc; 
   ...
   struct tokenStruct **tokenStructPtr =
   (struct tokenStruct **)input_token;   
   struct tokenStruct *tokenStruct = *input_token;  
   
   /* logic to decide whether to RESUME or not */   
   
   *result = 10;/* 10 = RESUME right after CEE3SRP call */
   tokenStruct->handled = tokenStruct->handled + 1; 
CEEMRCE(&(tokenStruct->resumePoint), &fc); 
} 

int main()
{
   _FEEDBACK feedback;
   struct tokenStruct myTokenStruct; 
   struct tokenStruct *tokenPtr = &myTokenStruct;
   tokenPtr = &myTokenStruct;
   _ENTRY pgmptr;

   pgmptr.address = (_POINTER)&badHandler; 
   pgmptr.nesting = NULL;

   tokenPtr->handled = 0;  
   CEE3SRP(&(tokenPtr->resumePoint), &feedback); 
   CEEHDLR(&pgmptr, &tokenPtr, &feedback);
   if (tokenPtr->handled > 0)
   {
   /* code to handle abend and get this program moving on it's way */
   }
   /* execute code that abends here */
   CEEHDLU(&pgmptr, &feedback);
   return 0;
}

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: CEE3SRP/CEEMRCE example in LE C?

2015-02-23 Thread Charles Mills
Here's CEE3DMP in C if that helps:

_CHAR80 dumpTitle = "blah blah blah";   // do not exceed 60 characters per 
z/OS V1R10.0 Language Environment Programming Reference
_CHAR255 dumpOptions = "BLOCKS,REGSTOR(256),FNAME(CZADIAG),NOENTRY";
_FEEDBACK fc;

CEE3DMP(dumpTitle, dumpOptions, &fc);

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Janet Graff
Sent: Monday, February 23, 2015 3:29 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: CEE3SRP/CEEMRCE example in LE C?

The LE Programming Guide has examples of using CEE3SRP and CEEMRCE in Cobol and 
PL/I.  I have mine coded in C.  Does anyone have a sample of calling for a 
resume in C that I can compare my attempt to?  I've got something funky about 
my addressing.  The proper token address is passed to the abend handler and the 
token points to my structure but my structure elements aren't formatted 
properly in the abend handler.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


CEE3SRP/CEEMRCE example in LE C?

2015-02-23 Thread Janet Graff
The LE Programming Guide has examples of using CEE3SRP and CEEMRCE in Cobol and 
PL/I.  I have mine coded in C.  Does anyone have a sample of calling for a 
resume in C that I can compare my attempt to?  I've got something funky about 
my addressing.  The proper token address is passed to the abend handler and the 
token points to my structure but my structure elements aren't formatted 
properly in the abend handler.

Janet

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN