RE: Download File to Excel from batch Job

mstansell

Member
RE: Download File to Excel from batch Job

If you use Client Access Express and have a NT or higher client you could
setup a box with CA Remote Command enabled and CA File Transfer.

then the RunRmtCmd process in a CL could be used to transfer the file
automatically.
Code Snippet:
OvrPrtf QSYSPRT QSYSPR98 LvlChk(*NO) Hold(*yes) /* Redirect */

RunRmtCmd CMD('RTOPCB +
"C:\Program Files\Ibm\Client Access\Emulator\Private\tqmrptt.dtf"')
RmtLocName('172.16.19.250' *IP) +
RmtUser('mstanse') RmtPwd('********') CCSID(437)
/* Cancel if Connection Refused */
Monmsg CPF91CC Exec(Goto Deallocate)
Dltovr Qsysprt

/* test spool file for Success/or errors (user/pwd/rqst..) */
CrtPf QTEMP/SPOOLCK2 RcdLen(166) LVLCHK(*NO)
monmsg cpf7302 Exec(ClrPfm qtemp/Spoolck2)
CpySplf QsysPr98 qtemp/spoolck2 SplNbr(*last)
monmsg Cpf3303 Exec(Goto Good2)

/* Loop Spoolck - If EOF w/o &Success=>ERROR */
.... error checking code in here ....

Note that the transfer request (tqmrptt.dtf) can specify BIF5 (excel format)
and it can put the file on any share it has rights for.

Happy Hunting!
Stans
 
Back
Top