0

I want to purge/cancel/spin a job by requesting the action to JES2 with the IEFSSREQ macro. Everything seems to work well but no job is affected by the request. I thought it was a filter problem in the SSJM structure but when I specify nothing in the filters I have no error (I should have one according to the documentation) and no job is affected as well.

Here is my code:

char *pcJobId = "JOB03101";
int iRc;
char * __ptr32 pworkArea = __malloc31(60);
memset(pworkArea, 0, 60);
struct ssib * __ptr32 pSSIB = __malloc31(sizeof(struct ssib));
struct ssob * __ptr32 pSSOB = __malloc31(sizeof(struct ssob));
struct ssjm * __ptr32 pSSJM = __malloc31(sizeof(struct ssjm));

memset(pSSIB, 0, sizeof(struct ssib));
memcpy(pSSIB->ssibid, "SSIB", 4);
pSSIB->ssiblen = SSIBSIZE;
memcpy(pSSIB->ssibssnm, "JES2", 4);

memset(pSSJM, 0, sizeof(struct ssjm));
memcpy(pSSJM->ssjmeye, "SSJMPL  ", 8);
pSSJM->ssjmlen = SSJMSIZE;
pSSJM->ssjmvrm = SSJMVRM1;
pSSJM->ssjmopt1 = SSJMPSYN;
pSSJM->ssjmreqp._ssjmtype = SSJMPRG;
pSSJM->ssjmsel1 = SSJMSOJI;
memcpy(pSSJM->ssjmojbi, pcJobId, 8);

memset(pSSOB, 0, sizeof(struct ssob));
memcpy(pSSOB->ssobid, "SSOB", 4);
pSSOB->ssoblen = SSOBHSIZ;
pSSOB->ssobfunc = (short int)85;
pSSOB->ssobssib = pSSIB;
pSSOB->ssobindv = (int)pSSJM;

void * __ptr32 * pParmList = __malloc31(4);
*pParmList = (void * __ptr32) ((int32_t)pSSOB | (int32_t)0x80000000); // the high-order bit must be on
iRc = 0;
__asm(" SAM31\n"
      " SYSSTATE AMODE64=NO\n"
      " IEFSSREQ\n"
      " SYSSTATE AMODE64=YES\n"
      " SAM64\n"
      : "=XL:NR:r15"(iRc)
      : "XL:NR:r1"(pParmList), "XL:NR:r13"(pworkArea)
      : "r0", "r1", "r13", "r14", "r15");
printf("IEFSSREQ rc=%d\n", iRc);
printf("ssobretn=%d\n", pSSOB->ssobretn);
printf("ssjmretn=%d\n", pSSJM->ssjmretn);
printf("ssjmret2=%d\n", pSSJM->ssjmret2);
printf("ssjmnsjf=%d\n", pSSJM->ssjmnsjf);
printf("ssjmsjf8=%p\n", pSSJM->ssjmsjf8);
free(pworkArea);
free(pSSOB);
free(pParmList);
free(pSSJM);

According to the documentation I get feedback for every jobs affected by the request in the SSJMSJF8 pointer and the SSJMNSJF should be the number of feedbacks I get, which is also the number of jobs affected by the request.

My code print this:

IEFSSREQ rc=0
ssobretn=0
ssjmretn=0
ssjmret2=0
ssjmnsjf=0
ssjmsjf8=0

Here is a link to the documentation I talked about. I'm using the Modify Job Function Call (number 85) and this is page 460.

https://www-304.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3SA380679/$file/ieaf200_v2r3.pdf

Machavity
  • 30,841
  • 27
  • 92
  • 100
Timothée
  • 77
  • 7

1 Answers1

1

I could not see something obvious. I tried to get your code working on our system, but I'm not good enough in C, unfortunately to complete what is not shown above.

Alternatively, I tried to get it running in plain assembler. I'm getting same results as you. I tried PURGE and CANCEL requests. All don't seem to do anything. However, when specifying an invalid jobid, IEFSSREQ complains with corresponding return codes, so I know the IEFSSREQ is being invoked correctly. Must be something stupid.

Sorry I can't be of more help so far

phunsoft
  • 2,674
  • 1
  • 11
  • 22
  • 1
    I was looking for RACF message, and cold not find any, so I thought the problem is not related to lack of authority. After all, all return codes were zero indicating a success call. However, as it turnes out, you need to setup the profiles in the JESJOBS class as desrcibed in the manual. Once I had the proper authority, the cancel request succeeded and the expected number of SSJF elements was returned. – phunsoft Jul 29 '18 at 19:18
  • I thought it could be that too but didn't test it. Thank you a lot for your help and your time, you really helped me! – Timothée Jul 30 '18 at 07:16