/* Get current job name and current library */
/* then delete any existing temporary data area with the same name */
RTVJOBA JOB(&JOB) CURLIB(&CURLIB)
DLTDTAARA DTAARA(&CURLIB/&JOB)
MONMSG CPF0000
/* Build Windows command to execute. Using START causes %USERNAME% to
be resolved. */
/* /B prevents extra windows from opening. */
CHGVAR VAR(&PCCMD) VALUE('START /B RMTCMD CRTDTAARA +
DTAARA(' || &CURLIB |< '/' || &JOB |< ') +
TYPE(*CHAR) LEN(10) VALUE(%USERNAME%) /Z')
STRPCO
MONMSG IWS4010
STRPCCMD PCCMD(&PCCMD) PAUSE(*NO) /* Send command to attached PC */
RTVDTAARA DTAARA(&CURLIB/&JOB) RTNVAR(&PCUSER) /* Retrieve the data
area */
DLTDTAARA DTAARA(&CURLIB/&JOB) /* Clean up */
SNDPGMMSG MSG('PC user name is: ' || &PCUSER) MSGTYPE(*COMP)
ENDPGM