Writing from the AS/400 to an external windows drive !!!!!

jberry

Member
I am trying to make my program write a text file onto a windows drive when ran on the AS/400. Currently when I run the program locally, it will write the text file to the windows drive, but when I submit from the AS/400 it does not write.

Is there a trick to make this happen or is it possible?

Please help,

Jimmy
OneWolrd ERP 8.0 SP23
Enterprise server: AS/400
 
I'm not sure if you're tyring to do this from a JDE program or an AS/400 C/L (Control Language) procedure, but the AS/400 has a command called CPYFRMSTMF and CPYTOSTMF that lets you copy from an AS/400 source file to a folder on the AS/400. An example is below:

CPYTOSTMF FROMMBR('QSYS.LIB/TEST.LIB/LABSRC.FILE/LABSRC.MBR')
TOSTMF(/LABELS/data.txt) STMFOPT(*REPLACE) CVTDTA(*AUTO) STMFCODPAG(437)

In the above example, "TEST.LIB" is a library on the AS400, "LABSRC.FILE" is a file in libary TEST and "LABSRC.MBR" is a member in the file LABSRC.
"/LABELS" is a folder on the AS400.
You can use command WRKLNK on an AS400 command line to see folders on the AS400.
 
If this is in a UBE, you can have the AS400 write a text file to the IFS structure, which is like an NT drive. The trick is you have to specify the directory structure using '/' instead of '\'
There are documents in PSFT on how to do this.
 
Fred,

Good point. I think using the "/" instead of "\" should solve the issue when run on the server. Also, please map the program so that it always runs on the server.
 
Back
Top