Example of writing a CLI macro file to define copy groups
The following examples show how to write a CLI macro file.
You must create a pair information CSV file in advance for the dataset pairCSVdataSetName specified for the INPAIR parameter.
#this is comment
YKDEFGRP [
GROUP cgid
PRIDAD LOCAL
SECDAD REMOTE
PRISCHSET 0
SECSCHSET 0
COPYTYPE UR
COPYPACE NORMAL
PROTECTMODE PROTECT
CTTIMEMODE ASIS
ERRORLEVEL GROUP
MIRRORID 1
]
YKIMPORT BASEGROUP(cgid) NEWGROUP(cgid) INPAIR(pairCSVdataSetName)
YKLOAD GROUP(cgid)
YKGETGRP GROUP(cgid)
Example of writing a CLI macro file to create copy pairs of a copy group
In this example, YKLOAD and YKMAKE are executed to create a copy pair, and then YKEWAIT is executed to wait until the status of the copy pair changes to DUPLEX. If a timeout occurs, the return code is 4. The condition for WARN is met, and YKEWAIT in the line following the label name LOOP will be executed. If execution ends normally, the condition for SUCCESS is met, and the processing proceeds to and ends at the line containing the label name TERM. If neither of the above occurs, YKGETGRP will be executed to output the abnormal copy pair.
YKLOAD GROUP(cgid) YKMAKE GROUP(cgid) LOOP: YKEWAIT GROUP(cgid) GOTO(DUPLEX) TIMEOUT(5) WARN LOOP SUCCESS TERM YKGETGRP GROUP(cgid) XSTATE(DUPLEX,PENDING) TERM: