Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example with macros

&pagelevel(4)&pagelevel

Change installation path and select product version

In this example, one of several installed versions of the SDF-I product is copied to the test user ID RZTEST and defined as the standard product version with system-wide validity.

The corresponding example with commands starts on "Example with commands ".

EXAMPLE CSECT
COPY     OPSYN
*
*  Dsects
*
GETIP    GETINSP MF=D,XPAND=PARAM
GETIPOUT GETINSP MF=D,XPAND=OUTPUT
*
GETIV    GETINSV MF=D,XPAND=PARAM
GETIVOUT GETINSV MF=D,XPAND=OUTPUT
*
SETIP    SETINSP MF=D
*
SELPR    SELPROV MF=D
*
COPYD    IDCOP D
*
*
PROG     ...
*
*  Init work register
*
         LA    R3,OUTPATH+4             Output area for GETINSP
         USING GETIPOUT,R3
         LA    R4,OUTAREA+4             Output area for GETINSV
         USING GETIVOUT,R4
*
         LA    R5,GETIPSK               PL skeleton for GETINSP
         USING GETIP,R5
         LA    R6,SETIPSK               PL skeleton for SETINSP
         USING SETIP,R6
         LA    R7,GETIVSK               Pl skeleton for GETINSV
         USING GETIV,R7
         LA    R8,COPYSK                PL skeleton for COPY
         USING COPYD,R8
         LA    R9,SELPRSK               PL skeleton for SELPROV
         USING SELPR,R9
*
*  Get all available versions of the installation unit SDF-I
*
*
         LA    R2,OUTAREA               Output area for GETINSV
         GETINSV MF=M,OUT@=(R2)         Fill OUT@ field
         GETINSV MF=E,PARAM=(R7)        Call function
*
         CLC   IMOGRET(4),=A(IMOVSUCC)  Function successful ?
         BNE   TERM                     NO -> Terminate
*
         LA    R2,OUTPATH               Output area for GETINSP
         GETINSP MF=M,OUT@=(R2)         Fill OUT@ field
*
*  For all returned versions, get the path name associated to the
*  Logical-id SYSPRG, copy the file under RZTEST userid and update
*  the path name
*
         LA    R2,4                     for loop limit
LOOP     C     R2,OUTAREA               End of area reached ?
         BNL   SELECT                   Yes, terminate
         GETINSP MF=M,IUVERS=IMOVOVER   Take current IU version
         GETINSP MF=E,PARAM=(R5)        Get path name
         CLC   IMOGRET,=A(IMOGSUCC)     OK ?
         BNE   TERM                     NO, terminate
*
* path name is available in IMOGOPAT field (in our example, it looks
* like this :  :SOLX:$TSOS.SYSPRG.SDF-I.vvv)
*
         MVC   IDBCFN1L,IMOGOPAT        Initial path name
         MVC   IDBCFN2L(8),=C'$RZTEST.'    New userid
         MVC   IDBCFN2L+8(42),IMOGOPAT+12  Move path name part
         COPY  MF=(E,(R8))
         LTR   R15,R15                  Copy OK ?
         BNZ   TERM                     NO, terminate
*
* Update the path name for the corresponding logical-id
*
         SETINSP MF=M,IUVERS=IMOVOVER,PATHNAM=IDBCFN2L
         SETINSP MF=E,PARAM=(R6)
         CLC   IMOSRET,=A(IMOSSUCC)     SETINSP OK ?
         BNE   TERM                     NO, terminate
*
         LA    R2,IMOVOMD#(R2)          Next Installation unit version
         B     LOOP
*
SELECT   DS    0H
*
* Select the first returned version for the system
*
         LA    R4,OUTAREA+4        Point on first returned version
         SELPROV MF=M,PRODNAM='SDF-I',PRODVER=IMOVOVER,SCOPE=*SYSTEM
         SELPROV MF=E,PARAM=(R9)
*
TERM     DS    0H
         ...
*
*   Constants for IMON calls
*
         DS    0F
GETIPSK  GETINSP MF=L,IUNAME='SDF-I',LOGID='SYSPRG',OUTLEN=88
*
         DS    0F
SETIPSK  SETINSP MF=L,IUNAME='SDF-I',LOGID='SYSPRG'
*
         DS    0F
GETIVSK  GETINSV MF=L,IUNAME='SDF-I',IUVERS=*ALL,OUTLEN=50
*
         DS    0F
SELPRSK  SELPROV MF=L,PRODNAM='SDF-I',SCOPE=*SYSTEM
*
         DS    0F
COPYSK   COPY  MF=L,INNAME,OUTNAME
*
OUTAREA  DS    0F
         DC    50CL1' '
*
OUTPATH  DC    88CL1' '
*
         ...
         END   EXAMPLE