You are on page 1of 2

http://Iseriesvenezuela.blogspot.com. Ing. Liliana Surez.

Programa en RPGLE Free para ejecutar comandos PC


* Aplicacin. . . : Tipos de fuente * Versin . . . . : 1.0 * Programa. . . . : PCCOMAND * Fecha . . . . . . 14/09/2009 * Autor(es) . . . : * Descripcin . . : Comandos PC * * Historial de Modificaciones: * *----------+-------+---------------+------------------* Fecha ! SR # ! Programmer ! Descripcin *------------------------------------------------------* mm/dd/yy *----------------------------------------------------/if defined(*crtbndrpg) h DftActgrp(*no) h bnddir('QSYS/QC2LE') h actgrp(*new) /EndIf hDebug Option(*SRCSTMT:*NODEBUGIO) hDatFmt (*ISO) hDftName(RPGPCC) hTimFmt(*HMS) hAut(*all) hFixNbr(*zoned) hText(*srcmbrtxt) hDecEdit('0,') DatEdit(*dmy/) hCopyRight(' ') *-----------------------------------------------------D commandString S 700A varying D pcCommand S 700A varying D ipAddress S 15A varying D displayString S 52A D @Addr S 15A D* D PGMDS SDS D @PGMNM *PROC D @JOB 244 253 D @USER 254 263 D* D DEVDDS DS 1024 D IPADDR 877 891 D*----------------------------------------------D* Prototype for QCMDEXC API D ExecuteCommand... D PR extPgm('QCMDEXC') D argInCommand 65535A const options(*varsize D argInLength 15P 5 const * * * * * * *

D**************************************************************** ***** * D Main pr EXTPGM('RPGPCC') D Pruta 100 D Main pi D Pruta 100 * /free /end-Free

Ing. Liliana Surez. Iseriesvenezuela.blogspot.com rpg.iseries@gmail.com

http://Iseriesvenezuela.blogspot.com. Ing. Liliana Surez. Programa en RPGLE Free para ejecutar comandos PC
C** Call the API to get the IP address C* C CALL 'QDCRDEVD' C PARM C PARM C PARM 'DEVD0600' C PARM @JOB C PARM C* C** Load the IP Address C* C MOVEL(P) IPADDR

DEVDDS DEVDLG DEVDFM DEVDNM DEVDER

4 8 10 256

@ADDR

/free // To Automatically open the file with the associated // application: // LINUX: xdg-open // MAC: open // WINDOWS: start commandString = 'STRPCO'; monitor; ExecuteCommand(%trim(commandString):%len(%trim(commandString))); on-error; endmon; pcCommand = 'start ' + %trim(pruta);

// STRPCCMD to open a PDF commandString = 'STRPCCMD PCCMD(''' + %trim(pcCommand) + ''') PAUSE(*NO)'; monitor; ExecuteCommand(%trim(commandString):%len(%trim(commandString))); on-error; displayString = 'ERROR occurred on STRPCCMD using QCMDEXC!'; DSPLY displayString; endmon; *inLr = *ON; /end-free

PUEDES DESCARGAR EL CDIGO EN ESTE ENLACE:


https://skydrive.live.com/?cid=f974c7d5a177a2fa&sc=documents#!/? cid=f974c7d5a177a2fa&sc=documents&id=F974C7D5A177A2FA%21105

Ing. Liliana Surez. Iseriesvenezuela.blogspot.com rpg.iseries@gmail.com

You might also like