DefineVariables:
PROC() RETURNS(BIN FIXED(31));
DCL Len BIN FIXED(31) AUTO NOINIT;
LEN = LENGTH(DDVAR);
CALL ISPLINK('VDEFINE ','DDVAR ',DDVAR,'CHAR ',LEN);
RETURN(PLIRETV());
END;
AllocDataSet:
PROC() RETURNS(BIN FIXED(31));
DCL Command CHAR(256) AUTO NOINIT;
DCL Len BIN FIXED(31) AUTO NOINIT;
Command =
'LMINIT DATAID(DDVAR) DATASET('
|| '''' || 'hlq.of.my.data.set' || ''''
|| ')'
|| ' ENQ(SHR)' ;
Len = LENGTH(TRIM(Command));
CALL ISPEXEC (Len,Command);
RETURN(PLIRETV());
END;
FreeDataSet:
PROC() RETURNS(BIN FIXED(31));
DCL Command CHAR(256) AUTO NOINIT;
DCL Len BIN FIXED(31) AUTO NOINIT;
Command = 'LMFREE DATAID(&DDVAR)';
Len = LENGTH(TRIM(Command));
CALL ISPEXEC (Len,Command);
RETURN(PLIRETV());
END;
SetStatsData:
PROC() RETURNS(BIN FIXED(31));
DCL Command CHAR(256) AUTO NOINIT;
DCL Len BIN FIXED(31) AUTO NOINIT;
Command =
'LMMSTATS DATAID(&DDVAR) MEMBER(mymember) '
|| 'CREATED(18/02/08) MODTIME(08:59) '
|| 'USER(BAUER)' ;
Len = LENGTH(TRIM(Command));
CALL ISPEXEC (Len,Command);
RETURN(PLIRETV());
END;
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Fri Jun 05, 2020 9:04 pm Post subject:
bauer,
I see that you used ISPEXEC instead of ISPLINK. Here is another way I got this working(wrote it on the fly without optimization). You probably can remove all the Display statements or move them to a common section.
Code:
//SYSIN DD *
STATPDS: PROCEDURE OPTIONS(MAIN);
DECLARE ISPLINK /* NAME OF ENTRY POINT */
ENTRY
EXTERNAL /* EXTERNAL ROUTINE */
OPTIONS( /* NEEDED OPTIONS */
ASM, /* DO NOT USE PL/I DOPE VECTORS */
INTER, /* INTERRUPTS */
RETCODE); /* EXPECT A RETURN CODE */
DECLARE PLIRETV BUILTIN;
IF RETCODE = 0 THEN
PUT FILE (FILEOUT) EDIT (ISPF_SERVICE ||
' IS SUCCESSFUL WITH ' ||
'RETURN CODE = ',PLIRETV)
(A,F(3));
ELSE DO;
PUT FILE (FILEOUT) EDIT (ISPF_SERVICE ||
' HAS FAILED WITH ' ||
'RETURN CODE = ',PLIRETV)
(A,F(3));
RETURN;
END;
END STATPDS;
And in the execution step you would need
Code:
//MYPDS DD DISP=SHR,DSN=Your PDS name
//FILEOUT DD SYSOUT=*
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Sun Jun 07, 2020 2:14 pm Post subject:
bauer,
Ideally I prefer having field names for the update, so that I am aware of the fields that I am updating. With buffer solution you have to take a guess as how each value is related to the specific field. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Jun 22, 2020 9:38 am Post subject:
bauer,
The reason behind that is quite simple. If we use the RUN/SELECT PGM to invoke our application program then the DB2 routine will not be able to make use of the ISPLLIB, - there is no way of passing the ISPLLIB DCB into the DB2 routines.
However, if we use CMD, then the DB2 routines will be able to access the ISPLLIB via the TASKLIB and locate its program modules. _________________ Kolusu
www.linkedin.com/in/kolusu
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