Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with rtmcmd

15 views
Skip to first unread message

giov

unread,
May 18, 2012, 9:10:39 AM5/18/12
to
Hi all

i find this example to retrive windows user name but i have two
problems:

1- The rmtcmd ask user and password iSeries
2- Came displayed the dos window

is it possible to avoid these problems ??


PGM
DCL &JOB *CHAR 10
DCL &PCCMD *CHAR 100
DCL &PCUSER *CHAR 10
DCL &CURLIB *CHAR 10

/* 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
0 new messages