Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Migration examples

&pagelevel(4)&pagelevel

This section provides examples dealing with the following subjects:

  • migration with compression

  • Migration by selection criteria

  • Migration by quantity

  • Eliminating memory bottlenecks on S0

  • Pubset-specific migration with display of pubset usage

  • automatic initiation of migration requests by means of ENTER jobs

  • Starting migration requests automatically by means of a program

The examples are based on the sample configuration described in "Creating an HSMS configuration (example)".

Migration with compression

Files are migrated to storage level S1 and compressed in the process. The save files are compared with the migrated files.

//MIGRATE-FILES -   ————————————————————————————————————————————————————  (1) 
//  FROM-STORAGE=*S0-STORAGE-LEVEL(FILE-NAMES=$MANUAL.FILE.0*, -
//    COMPRESS-FILES=*YES, -
//    TO-STORAGE=*S1-STORAGE-LEVEL), -
//  OPERATION-CONTROL=*PAR(REPORT=*FULL, -
//    OUTPUT=HSMS.MAN.R.MGF.1, -
//    WAIT-FOR-COMPLETION=*YES)
% HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED
Report HSMS.MAN.R.MGF.1 (extract):   ————————————————————————————————  (2)
 
 ***  MIGRATE - FILES                HSMS V12.0       FULL        REPORT  *** 2016-08-12  14:48:31    PAGE    2
REQUEST-NAME=MGF#0AAK REQUEST-DATE=2016-08-12 14:48:09 USER-ID=SYSHSMS  REQUEST-STATE=COMPLETED WITHOUT ERROR 
%  ARC0002 STATEMENT ACCEPTED. ARCHIVE SEQUENCE NUMBER 'A.160812.144811', VERSION '11.0'  
%  ARC0033 ARCHIVE SUBTASK TSN 0AAO GENERATED
                                     SAVE FILE IDENTIFIER - S.160812.144813             SUBSAVE
NUMBER       VSNS                 
   0        0:2BC                    
                                     SAVE FILE IDENTIFIER - S.160812.144813
                        ***   CATALOG - 2BY       USER - MANUAL     *** 
**   OUTPUT SAVE VERSION: SAVE-VERSION-DATE=16-08-12  SAVE-VERSION-TIME=14:48:13  * 
            FILE/JOB VARIABLE NAME                  LASTPG/  SAVE    INPUT DEV  SUB  OUTPUT
                                               VERS     SIZE  TYPE    VSN  TYP SAVE  VSN(S)  
FILE.01                                         1          3  FULL  2BY.01  D     0  0:2BC
FILE.02                                         1          8  FULL  2BY.01  D     0  0:2BC  
FILE.03                                         1         13  FULL  2BY.01  D     0  0:2BC  
FILE.04                                         1         18  FULL  2BY.01  D     0  0:2BC  
FILE.05                                         1         16  FULL  2BY.00  D     0  0:2BC  
FILE.06                                         1         11  FULL  2BY.00  D     0  0:2BC  
FILE.07                                         1          6  FULL  2BY.00  D     0  0:2BC 
 ***      E N D   O F                 HSMS V12.0       FULL         REPORT  *** 2016-08-12  12:19:05     ***
 
/SHOW-FILE-ATT FILE-NAME=$MANUAL.FILE.0*, -   ——————————————————————————  (3)
/  INFORMATION=SPACE-SUMMARY
%:2BY:  PUB/S1:     7  FILES RES=        90  FRE=       15 REL=       9 PAGES 
/SHOW-FILE-ATT FILE=:2BC:$*.ARCHIVE.SAVE.FILE.160812.144813., -
/  INFORMATION=SPACE-SUMMARY
%:2BC:  PUBLIC:     1  FILE  RES=        12  FRE=        2 REL=       0 PAGES 

(1)

The files named FILE.0.. of user ID MANUAL are migrated to the system migration archive.

(2)

Extract from the HSMS-generated report of the migration run with output of the SFID.

(3)

Comparison of the migrated files with the save files to which they were written shows the reduced space requirements of the compressed save file. Since the migrated files no longer occupy storage space, the difference in space has been saved.

Migration by selection criteria

The files are selected and migrated on the basis of the retention period criterion.

/SHOW-FILE-ATTRIBUTES FILE-NAME=$MANUAL.FILE.1*, -   ———————————————————  (1) 
/  SELECT=*BY-ATTRIBUTES(STORAGE-LEVEL=*S0, -
/  EXPIRATION-DATE=*INTERVAL(TO=+365)), -
/  OUTPUT=#SELECT-LIST(FORM-NAME=*FILE-NAME)
%:2BY:  PUBLIC:    7  FILES RES=      90  FREE=       15  REL=        9 PAGES 
/START-HSMS
//MIGRATE-FILES -   ————————————————————————————————————————————————————  (2) 
//  FROM-STORAGE=*S0-STORAGE-LEVEL(FILE-NAMES=*FROM-FILE -
//    (#SELECT-LIST),COMPRESS-FILES=*YES, -
//    TO-STORAGE=*S1-STORAGE-LEVEL), -
//  OPERATION-CONTROL=*PAR(REPORT=*FULL, -
//    OUTPUT=HSMS.MAN.R.MGF.2, -
//    WAIT-FOR-COMPLETION=*YES)
% HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED 

(1)

The SHOW-FILE-ATTRIBUTES command writes a list of all files named FILE.1.. which belong to user ID MANUAL and whose retention period expires within the next 365 days to a temporary file. This selects those files whose retention period is situated within the retention period of the save file of the migration archive.

(2)

The files contained in the list created by the command are migrated to the system migration archive.

Migration by quantity

Files are migrated until a certain number of PAM pages are free.

//MIGRATE-FILES -  ————————————————————————————————————————————————————  (1) 
//  FROM-STORAGE=*S0-STORAGE-LEVEL(FILE-NAMES=$MANUAL.FILE.2*, -
//    RELEASE-PAGES=100,-  ————————————————————————————————————————————  (2) 
//    COMPRESS-FILES=*YES,TO-STORAGE=*S1-STORAGE-LEVEL), -
//  OPERATION-CONTROL=*PAR(REPORT=*FULL, -
//    OUTPUT=HSMS.MAN.R.MGF.3, -
//    WAIT-FOR-COMPLETION=*YES)
%  HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED 

(1)

The files named FILE.2.. of user ID MANUAL are migrated to the system migration archive.

(2)

HSMS stops migrating files as soon as at least 100 PAM pages are free, i.e. only a subset of the specified files is migrated.

Eliminating memory bottlenecks on S0

In order to create space on public volumes, files which have not been accessed for a least 28 days are migrated to S1. Specifying SHOW-PUBSET-USAGE
INFORMATION=*UNUSED-DAYS beforehand enables users to see whether the space released in this manner will be enough.

//MIGRATE-FILES FROM-STORAGE=*S0-STORAGE-LEVEL -  —————————————————————  (1) 
// (FILE-NAMES=:2BY:$*.,TO-STORAGE=*S1-STORAGE-LEVEL, -
//    UNUSED-DAYS=28), -
//  OPERATION-CONTROL=*PAR(REPORT=*FULL, -
//    OUTPUT=HSMS.MAN.R.MGF.1, -
//    WAIT-FOR-COMPLETION=*YES)
% HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED 

(1)

All files on pubset 2BY which have not been accessed for at least 28 days are migrated to storage level S1.Specifying *ALL is not practical due to the pubset-specific assignment of the system migration archives; *ALL always refers to all files of all pubsets.

Pubset-specific migration with display of pubset usage

A few large files are migrated in order to demonstrate the effect of migration on pubset allocation.

//SHOW-PUBSET-USAGE ———————————————————————————————————————————————————  (1)

 SHOW-PUBSET-USAGE                                          INFORMATION = SUMMARY 
 CATALOG-ID = ALL 
 -------------------------------------------------------------------------------
  PUBSET  ST    CAPACITY   %USED  %AVAIL    %MIG     S1-MIG   S1-USED  S1-AVAIL 
  BVWC    S0      225657    87.0    13.0      .0          0    593178     70167 
  2BC     S1      663345    89.4    10.6      .0
  2BY     S0      663345    77.5    22.5      .0        135    593178     70167 
 ...
 ...
 ...
 NEXT-PAGE: +  (+, -, ++, --, E)
 %  HSM0012 END OF OUTPUT LIST REACHED
% HSM0003 HSMS STATEMENT COMPLETED
//MIGRATE-FILES -   ————————————————————————————————————————————————————  (2) 
//  FROM-STOR=*S0-STOR(F-NAMES=:2BY:$MANUAL.MAX-SIZE.*, -
//    MIN-SIZE=150,MAX-SIZE=2500,TO-STOR=*S1-STOR), -
//  OPER-CONTROL=*PAR(REPORT=*NONE)
% HSM0003 HSMS STATEMENT COMPLETED 
//MIGRATE-FILES -
//  FROM-STOR=*S0-STOR(F-NAMES=:BVWC:$MANUAL.MAX-SIZE.*, -
//    MIN-SIZE=150,MAX-SIZE=2500,TO-STOR=*S1-STOR), -
//  OPER-CONTROL=*PAR(REPORT=*NONE)
% HSM0003 HSMS STATEMENT COMPLETED
//MIGRATE-FILES -   ————————————————————————————————————————————————————  (3) 
//  FROM-STOR=*S0-STOR(F-NAMES=:2BY:$MANUAL.MAX-SIZE.*, -
//    MIN-SIZE=2500,TO-STOR=*S2-STOR), -
//  OPER-CONTROL=*PAR(REPORT=*NONE)
% HSM0003 HSMS STATEMENT COMPLETED 
//MIGRATE-FILES -
//  FROM-STOR=*S0-STOR(F-NAMES=:BVWC:$MANUAL.MAX-SIZE.*, -
//    MIN-SIZE=2500,TO-STOR=*S2-STOR), -
//  OPER-CONTROL=*PAR(REPORT=*NONE)
% HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED
/SHOW-FILE-ATTR :*:$MANUAL.MAX-SIZE.*   ————————————————————————————————  (4)
%0000001302#:BVWC:$MANUAL.MAX-SIZE.2 
%0000095004#:BVWC:$MANUAL.MAX-SIZE.4 
%0000080004 :BVWC:$MANUAL.MAX-SIZE.6
%0000001302#:2BY:$MANUAL.MAX-SIZE.1
%0000095004#:2BY:$MANUAL.MAX-SIZE.3
%0000080004 :2BY:$MANUAL.MAX-SIZE.5
%SUM    PUBLIC:      2 FILES RES=    160008 FRE=   160008 REL=   160008 PAGES
%SUM    PUB/S1:      2 FILES RES=      2604 FRE=     2050 REL=     2046 PAGES
%SUM    PUB/S2:      2 FILES RES=    190008 FRE=   160012 REL=   160008 PAGES
//SHOW-PUBSET-USAGE --------------------------------------------------- (05)


 SHOW-PUBSET-USAGE                                          INFORMATION = SUMMARY 
 CATALOG-ID = ALL 
 ------------------------------------------------------------------------------- 
  PUBSET  ST    CAPACITY   %USED  %AVAIL    %MIG     S1-MIG   S1-USED  S1-AVAIL 
  BVWC    S0      225657    44.3    55.7    42.6       1302    593772     69573 
  2BC     S1      663345    89.5    10.5      .0
  2BY     S0      663345    63.0    37.0    14.5       1437    593772     69573 
 ...
 ...
 ...
 NEXT-PAGE: +  (+, -, ++, --, E)
 %  HSM0012 END OF OUTPUT LIST REACHED
% HSM0003 HSMS STATEMENT COMPLETED
//END
% HSM0014 HSMS PROGRAM TERMINATED

(1)

Display of pubset usage. No files have been migrated. S0 pubsets show a utilization level of over 70%.

(2)

All files under the user ID MANUAL begining with the name MAX-SIZE. and between 150 and 2500 pages large are migrated to S1. In other words, the medium-sized files are written to disk. No report is generated. Any file information can be fetched by reference to the catalog.


(3)

All files under the user ID MANUAL begining with the name MAX-SIZE. and larger than 2500 pages are migrated to S2. In other words, these files are written to magnetic tape cartridge.

(4)

A SHOW-FILE-ATTRIBUTES statement displays the migrated files and the storage level to which they have been written.
MANUAL.MAX-SIZE.5 and.6 have not been migrated, as they are protected by a migration inhibit.

(5)

The pubset usage is displayed again: the percentage of free pages on the S0 pubsets has increased. (%USED and %AVAIL still show 100%, even though %MIG is now also greater than 0. Both values refer solely to the data currently on the pubset, not to the migrated data.)


Starting migration requests automatically by means of an ENTER job

On S0 pubset 2BY, files are to be migrated automatically once saturation level 4 or 5 has been reached. This is achieved by starting the ENTER job after HSMS loading. Execution comments are documented in the job.

/.AUTOMIG  SET-LOGON-PARAMETERS
/          REMARK ====================================================
/          REMARK === CATID and STORAGE LEVEL of the pubset to     ===
/          REMARK === be monitored and, possibly generated from    ===
/          REMARK === this, the name of the MIGRATION JV can be    ===
/          REMARK === passed as QUASI PARAMETERS in temp. JV!      ===
/          REMARK ====================================================
/          SET-JV-LINK JV-NAME=#CATID
/          MODIFY-JV   JV-NAME(#CATID),VALUE='2BY'
/          REMARK >>>>>> Match CATID >>>>>>^<<<<<< Match CATID <<
/          REMARK
/          SET-JV-LINK JV-NAME=#ST-LEVEL
/          MODIFY-JV   JV-NAME(#ST-LEVEL),VALUE='S0'
/          REMARK >>>>>> Match STORAGE LEVEL >^<<<<<< Match ST-LEVEL <
/          REMARK
/          SET-JV-LINK JV-NAME=#MIGJV
/          MODIFY-JV   JV-NAME(#MIGJV),                       -
/                      VALUE='$SYSHSMS.SYS.HSM.MIGRATE.&(#CATID)'
/          REMARK
/          REMARK
/          REMARK ====================================================
/          REMARK === Synchr. wait for HSMS subsystem activation    ==
/          REMARK === Spin-off if not loaded after waiting time!    ==
/          REMARK ====================================================
/          REMARK
/          WAIT-EVENT  UNTIL=                                 -
/               JV((&(#MIGJV),1,4) NE X'FFFFFFFF')
/          REMARK ====================================================
/          REMARK  When saturation level 4 or 5 is reached, space can
/          REMARK  be made with the MIGRATION function.
/          REMARK
/          REMARK  Releasing the number of pages entered in the
/          REMARK  MIGRATION JV is sufficient to reach the next-lower
/          REMARK  saturation level
/          REMARK ====================================================
/.WAIT     WAIT-EVENT UNTIL=                                  -
/               JV((&(#MIGJV),3,1) GE C'4'),                  -
/               TIMEOUT-LABEL=TIMEOUT
/          REMARK ====================================================
/          REMARK == When HSMS terminates, this job is also terminated
/          REMARK == terminate
/          REMARK ====================================================
/          SKIP-COMMANDS TO-LABEL=LOGOFF,                     -
/            IF=JV((&(#MIGJV),3,1) EQ X'FF')
/          REMARK ====================================================
/          REMARK ==== Extract number of pages to be released     ====
/          REMARK ==== and issue migration request                ====
/          REMARK ====================================================
/          SET-JV-LINK JV-NAME=#PAGES
/          MODIFY-JV   JV-NAME(#PAGES),                       -
/                 VALUE=JV(JV-NAME=&(#MIGJV),
/                          POSITION=36, LENGTH=10)
/          REMARK
/          REMARK
/          SKIP-COMMANDS  TO-LABEL=MIGS1,                     -
/                 IF=JV(#ST-LEVEL EQ 'S1')
/.MIGS0    REMARK ====================================================
/          REMARK ==== For S0 pubset:  normal migration ....      ====
/          REMARK ====================================================
/          ASSIGN-SYSDTA TO-FILE=*SYSCMD
/          START-HSMS
//MIGRATE-FILES FROM-STORAGE=*S0-STORAGE-LEVEL                -
//           (FILE-NAMES=:&(#CATID):$*.,                      -
//           TO-STORAGE=*S1-STORAGE-LEVEL),                   -
//         RELEASE-PAGES=&(#PAGES),                           -
//         OPERATION-CONTROL=*PARAMETERS(EXPRESS-REQUEST=*YES)
//END
/          SKIP-COMMANDS TO-LABEL=CONT
/.MIGS1    REMARK ====================================================
/          REMARK ==== For S1 pubset:  ... reorganization         ====
/          REMARK ====================================================
/          ASSIGN-SYSDTA TO-FILE=*SYSCMD
/          START-HSMS
//MIGRATE-FILES FROM-STORAGE=*S1-STORAGE-LEVEL                -
//          (S1-PUBSET-ID=&(#CATID),                          -
//           TO-STORAGE=*S1-STORAGE-LEVEL),                   -
//         RELEASE-PAGES=&(#PAGES),                           -
//         OPERATION-CONTROL=*PARAMETERS(EXPRESS-REQUEST=*YES)
//END
/.CONT     REMARK ====================================================
/          REMARK ==== Wait until HSMS modifies JV               =====
/          REMARK ====================================================
/          SET-JV-LINK JV-NAME=#LAST-TIME
/          MODIFY-JV   JV-NAME(#LAST-TIME),                   -
/                 VALUE=JV(JV-NAME=&(#MIGJV),                 -
/                          POSITION=50, LENGTH=25)
/          WAIT-EVENT UNTIL=JV                                -
/            ((&(#MIGJV),50,25) NE (#LAST-TIME,1,25))
/          REMARK
/          REMARK ====================================================
/          REMARK ==== As long as HSMS is active, the pubset       ===
/          REMARK ==== continues to be monitored                   ===
/          REMARK ====================================================
/          SKIP-COMMANDS TO-LABEL=WAIT,                       -
/             IF=JV((&(#MIGJV),3,1) NE X'FF')
/          SKIP-COMMANDS TO-LABEL=LOGOFF
/          REMARK
/.TIMEOUT  REMARK ====================================================
/          REMARK ==== Waiting time expired, but event has not     ===
/          REMARK ==== occurred; tolerance: up to 10 wait cycles!  ===
/          REMARK ====================================================
/          SKIP-COMANDS  TO-LABEL=WAIT,                       -
/             IF=JV($SYSJV.COUNTER LE '0010')
/          SET-JOB-STEP
/          REMARK ====================================================
/          REMARK ==== Spin-off due to /WAIT-EVENT, timeout or     ===
/          REMARK ==== real error; report printed                  ===
/          REMARK ====================================================
/          LOGOFF  SYSTEM-OUTPUT=*PRINT
/.LOGOFF   REMARK ====================================================
/          REMARK ==== Normal termination after unloading HSMS     ===
/          REMARK ====================================================
/          LOGOFF  SYSTEM-OUTPUT=*DELETE

 

Starting migration requests automatically by means of a program

Two events are defined in the program: reaching saturation level 1 and termination of the HSMS session. Once the saturation level has been reached, files are migrated via the HSMS macro. (Use of the HSMS macro is discussed in section "Calling HSMS from programs".)

Execution comments are documented in the program.

JVTEST   START
         PRINT NOGEN
         AMODE ANY
         RMODE ANY
         GPARMOD 31
         BASR  R10,0
         USING *,R10
*
*     Definition of event codes for two cases:
*     1. Pubset allocation exceeds the specified saturation
*        level 1 and files are to be migrated.
*     2. The HSMS session is terminated, and this program is to be
*        terminated as a consequence.
*
         ENAEI EINAME=MIGRATE,EIIDRET=IDMIGR
         ENAEI EINAME=TERMINAT,EIIDRET=IDTERM
*
*
*     The event of saturation level 1 being exceeded
*     is to be handled asynchronously; a contingency is
*     defined for this purpose.
*
         ENACO CONAME=COMIGR,COADAD=CONTADD,COIDRET=IDCONT
*
*
*     The conditions for the events defined above are
*     specified:
*     1. Saturation level 1 is exceeded in the pubset with catalog ID
*        '2BC', i.e. the associated job variable assumes the value '1'
*        in position 4.
*     2. HSMS is unloaded and the pubset is no longer supported by HSMS,
*        i.e. the job variable for the pubset assumes the value
*        x'ff...ff' in the first 40 positions.
*
         ONEVT '($SYSHSMS.SYS.HSM.MIGRATE.2BC ,4,1)=C''1''',           -
               EIID=IDMIGR,POST='MIGR'
*
         ONEVT '($SYSHSMS.SYS.HSM.MIGRATE.2BC ,4,1)=X''FF''',          -
               EIID=IDTERM,POST='TERM'

*
         XC    RESPONSE,RESPONSE
*
*
*      Signals are requested for the defined events.
*
*      Waiting asynchronously for saturation level 1 to be
*      exceeded (waiting time: 10 minutes):
*
         SOLSIG EIID=IDMIGR,                                           -
               COID=IDCONT,LIFETIM=600
*
*      Waiting synchronously for HSMS to be terminated
*      (waiting time: 12 minutes):
*
         SOLSIG EIID=IDTERM,COND=UNCOND,                               -
               LIFETIM=720,RPOSTAD=RESPONSE
*
DISEI    DS    0H
*
*      Deactivating the declared event codes:
*
         DISEI EIID=IDMIGR
         DISEI EIID=IDTERM
*
TERM     DS    0H
*
*      Program termination
*
         TERM
*
         EJECT ,
CONTA    DS    0H
**********************************************************************
*                                                                    *
*      Runtime code for contingency handling on exceeding            *
*      the saturation level                                          *
*                                                                    *
**********************************************************************
         BALR  10,0
         USING *,10
*
*
*      Start message: 'MIGRATION CONTINGENCY STARTED'
*
*
         WROUT TEXT1,RETCO
*
*      Calling the proposed migration statement via the
*      HSMS macro
*
         PRINT GEN
         HSMS  MF=S,ADDR=HSMSSTRG,LENGTH=255
         PRINT NOGEN
*
*
*      TERMINATING THE CONTINGENCY
*
*
RETCO    DS    0H
         RETCO
**********************************************************************
*                                                                    *
*     Definition of the migration statement to be executed:          *
*     files comprising at least 5000 PAM pages are to be             *
*     migrated to S1.                                                *
*                                                                    *
**********************************************************************
HSMSSTRG DC    CL255'MIGRATE-FILES FROM-STORAGE=*S0-STORAGE-LEVEL/
               (FILE-NAMES=:2BC:$*.,RELEASE-PAGES=5000,TO-STORAGE-LEVEL=/
               *S1-STORAGE-LEVEL)'
*
*
*      Definition of the message text
*
TEXT1    DC    Y(TEXT1E-TEXT1)
         DS    XL3
         DC    C'MIGRATION CONTINGENCY STARTED'
TEXT1E   EQU   *
*
IDMIGR   DS    F
IDTERM   DS    F
IDCONT   DS    F
RESPONSE DS    2F
*
CONTADD  DC    A(CONTA)
R10      EQU   10
         END