MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Set ISPF statistic data using PL/1 or IEBUPDT Utility

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Thu Jun 04, 2020 11:40 am    Post subject: Set ISPF statistic data using PL/1 or IEBUPDT Utility Reply with quote

Hallo *,

I have some PDS datasets with some members.

Using TSO / ISPF the statistic data like UserID, Created, mod time is set.

Using PL/1 logic (or IBM IEBUPDTE utility) this data is not set.

How is it possible to set this data?

I found this: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.f54sg00/ispsg378.htm.

Is there any interface / option to set the date fields in PDS datasets using PL/1 or IEBUPDTE ?

Thank you,
kind regards,
bauer



Additional remark: ISPLINK seems to be the correct interface to invoke ISPF functions from PL/1 - I will test it and give feedback.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Thu Jun 04, 2020 9:04 pm    Post subject: Reply with quote

bauer,

Unfortunately IEBUPDTE was invented before the invention of ISPF statistics. So you cannot update the stats using IEBUPDTE.

As you figured LMSTATS can be used to update the stats. You can try using ISPLINK to invoke LMSTATS.

Why can't you use ISPF Option 3.5 (Reset ISPF Statistics ) ?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Fri Jun 05, 2020 5:11 am    Post subject: Reply with quote

Well, thank you first of all.

My problem is:

Batch jobs creates or updates members on PO dataset. ISPF stats data is empty.

Members are transferred by FTP to windows environment.

The logic there requires the creation date, update date of the transferred members.

This process (creation of PDS members, FTP) happens periodically, every night.

So the ISPF option 3.5 of course works for any single transfer just for testing but not for periodic transfer.


I tried to code a PL/1 logic with LMSTATS and ISPLINK. The program compiles / links. But I can not execute the program by JCL.

If I do something like EXEC PGM=<myProgram> I receive error code 20 from the ISPLINK.

If I do something like. EXEC PGM=IKJEFT01 it is not really clear which parameters, libraries I should provide for IKJEFT01.


Confusing.

Is there any PL/1 or Cobol sample available?


Last edited by bauer on Fri Jun 05, 2020 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Fri Jun 05, 2020 12:40 pm    Post subject: Reply with quote

Topic is solved after some additional hours reading manuals and some tests.

This is the PL/1 proof of concept program for updating PDS dataset statistic data.

JCL for executing see below.

Reference to IBM documentation see comment inside the PL/1 coding.

May be this sample coding is useful for somebody else.

Code:


 
TEST7:
PROC OPTIONS(MAIN) REORDER ;
 
/* Demo Program: Sets on PDS Datasets the statistics Infos
*/
 
 
/* See IBM Manual
    z/OS
    Version 2 Release 3
    ISPF Services Guide
    IBM
    SC19-3626-30
*/
 
 
DECLARE ISPQRY
EXT ENTRY
OPTIONS( ASM, INTER, RETCODE);
 
DECLARE ISPEXEC
EXT ENTRY
OPTIONS( ASM, INTER, RETCODE);
 
DECLARE ISPLINK
EXT ENTRY
OPTIONS( ASM, INTER, RETCODE);
 
 
DCL DDVAR        CHAR(8)        AUTO NOINIT;
 
IF isISPFActive() THEN DO;
 
    IF DefineVariables() = 0 THEN DO;
    END;
    ELSE DO;
       SIGNAL ERROR;
    END;
 
    IF AllocDataSet() = 0 THEN DO;
    END;
    ELSE DO;
       SIGNAL ERROR;
    END;
 
    IF SetStatsData() = 0 THEN DO;
    END;
    ELSE DO;
       SIGNAL ERROR;
    END;
 
    IF FreeDataSet() = 0 THEN DO;
    END;
    ELSE DO;
       SIGNAL ERROR;
    END;
 
END;
ELSE DO;
    SIGNAL ERROR;
END;
 
isISPFActive:
   PROC() RETURNS(BIT(1));
   CALL ISPQRY();
   RETURN(PLIRETV = 0);
   END;
 
 
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;
 
END; 
 





Sample JCL to execute the program


Code:


//SETSTATS  EXEC PGM=IKJEFT01
//STEPLIB   DD DSN=hlq.of.your.loadlib,DISP=SHR
//SYSEXEC   DD DISP=SHR,DSN=hlq.your.installation
//SYSPROC   DD DISP=SHR,DSN=hlq.your.installation
//ISPMLIB   DD DISP=SHR,DSN=hlq.your.installation
//ISPPLIB   DD DISP=SHR,DSN=hlq.your.installation
//ISPSLIB   DD DISP=SHR,DSN=hlq.your.installation
//          DD DISP=SHR,DSN=hlq.your.installation
//ISPTLIB   DD DISP=SHR,DSN=hlq.your.installation
//ISPLOG    DD SPACE=(CYL,(1,1,1)),
//             DCB=(RECFM=FB,BLKSIZE=3120,LRECL=80)
//ISPPROF   DD SPACE=(CYL,(1,1,1)),
//             DCB=(RECFM=FB,BLKSIZE=3120,LRECL=80)
//SYSPRINT  DD SYSOUT=*
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
  ISPSTART PGM(TEST7)
/*




Enjoy Smile
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Fri Jun 05, 2020 9:04 pm    Post subject: Reply with quote

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;                                       
                                                               
 DECLARE ISPF_SERVICE    CHAR(08) INIT(' '),                   
         ISPF_DATAID     CHAR(08) INIT(' '),                   
         ISPF_PROJECT    CHAR(08) INIT(' '),                   
         ISPF_GROUP1     CHAR(08) INIT(' '),                   
         ISPF_GROUP2     CHAR(08) INIT(' '),                   
         ISPF_GROUP3     CHAR(08) INIT(' '),                   
         ISPF_GROUP4     CHAR(08) INIT(' '),                   
         ISPF_TYPE       CHAR(08) INIT(' '),                   
         ISPF_DSNAME     CHAR(44) INIT(' '),                   
         ISPF_DDNAME     CHAR(08) INIT(' '),                   
         ISPF_SERIAL     CHAR(08) INIT(' '),                   
         ISPF_PSWD_VAL   CHAR(08) INIT(' '),                   
         ISPF_ENQ_VAR    CHAR(08) INIT(' '),                   
         ISPF_ORG_VAR    CHAR(08) INIT(' ');               
                                                               
 RETCODE = 0;                                                   
 DECLARE                                                       
 1 VARS,                                                       
   3 CVAR1   CHAR(4),                                           
   3 CVAR2   CHAR(4),                                           
   3 CVAR3   CHAR(8),                                           
 FVAR      CHAR(8),                                             
 LARR(3)   FIXED BIN(31);                                       
 FVAR = 'CHAR';                                                 
 LARR(1) = 4;                                                   
 LARR(2) = 4;                                                   
 LARR(3) = 8;   
                                               
 CALL ISPLINK ('VDEFINE ','(CVAR1 CVAR2 CVAR3)',               
 VARS,FVAR,LARR,'LIST ',' ','LFORMAT'); 


IF RETCODE = 0 THEN                                       
   PUT FILE (FILEOUT) EDIT (' VDEFINE SUCCESSFUL '    ||   
                            'RETURN CODE = ',PLIRETV)     
                            (A,F(3));                     
ELSE DO;                                                   
   PUT FILE (FILEOUT) EDIT (' VDEFINE FAILED WITH'    ||   
                            'RETURN CODE = ',PLIRETV)     
                            (A,F(3));                     
   RETURN;                                                 
   END;                                                   
                                                           
ISPF_SERVICE = 'LMINIT';                                   
ISPF_PROJECT = 'ISPF';                                     
ISPF_DATAID  = 'CVAR3';                                   
ISPF_DDNAME  = 'MYPDS';                                   
ISPF_ENQ_VAR = 'SHR';                                     
ISPF_TYPE    = 'PLIOPT';                                   
                                                           
CALL  ISPLINK (ISPF_SERVICE,                               
               ISPF_DATAID,                               
               ISPF_PROJECT,                               
               ISPF_GROUP1,                               
               ISPF_GROUP2,                               
               ISPF_GROUP3,                               
               ISPF_GROUP4,                               
               ISPF_TYPE,                                 
               ISPF_DSNAME,                               
               ISPF_DDNAME,                               
               ISPF_SERIAL,                               
               ISPF_PSWD_VAL,                             
               ISPF_ENQ_VAR,                               
               ISPF_ORG_VAR,                               
               RETCODE);                                   
                                                                             
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;                                                     
                                                             
PUT SKIP LIST('CVAR3 IS :',CVAR3);                           
                                                             
DECLARE STAT_MEM_NAME CHAR (8);                             
DECLARE STAT_VERSION  FIXED BIN(31,0);                       
DECLARE STAT_MODLVL   FIXED BIN(31,0);                       
DECLARE STAT_CREDATE  CHAR (8);                             
DECLARE STAT_MODDATE  CHAR (8);                             
DECLARE STAT_CRETIME  CHAR (8);                             
DECLARE STAT_MODTIME  CHAR (8);                             
DECLARE STAT_INITSIZE FIXED BIN(31,0);                       
DECLARE STAT_MODRECS  FIXED BIN(31,0);                       
DECLARE STAT_USERID   CHAR(8);                               
                                                             
ISPF_SERVICE  = 'LMMSTATS';                                 
ISPF_DATAID   = CVAR3;                                       
STAT_MEM_NAME = 'XXXLANG';                                   
STAT_VERSION  = 01;                                         
STAT_MODLVL   = 01;                                         
STAT_CREDATE  = '20/01/01';                                 
STAT_MODDATE  = '20/06/05';                                 
STAT_MODTIME  = '01:01:01';                                 
STAT_INITSIZE = 8;                                           
STAT_MODRECS  = 8;                                           
STAT_USERID   = 'KOLUSU';                                   
                                                             
CALL  ISPLINK (ISPF_SERVICE,                                 
               ISPF_DATAID,                                   
               STAT_MEM_NAME,                                 
               STAT_VERSION,                                 
               STAT_MODLVL,                                   
               STAT_CREDATE,                                 
               STAT_MODDATE,                                 
               STAT_MODTIME,                                 
               STAT_INITSIZE,                                 
               STAT_MODRECS,                                 
               RETCODE);                                     
                                                             
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=*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Sat Jun 06, 2020 3:28 am    Post subject: Reply with quote

kolusu,

great - so we have here in mvsforums a nice sample coding for both options.
Thank you for your work & time.

kind regards,
bauer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Sun Jun 07, 2020 2:14 pm    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Jun 22, 2020 1:58 am    Post subject: Reply with quote

Update / Remark:

What me caused some confusion is the combination of ISPLINK / ISPEXEC and DB2.

What I did:

PL/1 Compile with SYSTEM(MVS)
Link with DSNALI for the interface to DB2
Run JCL (extract)

Code:


//SETSTATS  EXEC PGM=IKJEFT01
//SYSTSIN   DD *
   DSN SYSTEM(<DB2 subsystem ID>)
   RUN CP PLAN(<plan name>)
   ISPSTART PGM(<name load>)
   END




instead of (what we normally use)

Code:


 DSN SYSTEM(<DB2 subsystem ID>)
 RUN  PROGRAM(<program name>) PLAN(<planname>) -
      LIB(<loadlib>)




May be, this information is helpful for somebody .....
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Mon Jun 22, 2020 9:38 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group