Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPYTOIMPF from csv to a 400 PF

Status
Not open for further replies.

OAKEJ

Programmer
Apr 13, 2005
39
0
0
US
I need to upload a csv file from my pc into a PF in the 400? Does anyone know how I could do that in a CLP routine?

I've tried using the CPYTOIMPF from the command line without success.

CPYFRMIMPF FROMSTMF('I:\TMP\AURAPARTS.CSV') TOFILE(IESR7TEST/AURPARTS) RCDDLM(*CLRF)
 
Local PC drives are not accesible by CPYFRMIMPF. What you need to do is map a folder on the IFS to a share, and put your source file there.

In the CPYFRMIMPF command, you use the IFS path, NOT the PC path.

In iSeries Navigator:

Sign in.
Expand File Systems.
Expand Integrated File System.
Right-click on Root, choose New Folder. For this example, I'll call it flapeyre. Share it by right-clicking on the folder, choose Sharing, New Share.

You should then be able to see it in Windows as \\AS400name\flapeyre.

Your CL command then needs to be:
Code:
CPYFRMIMPF FROMSTMF('/flapeyre/AURAPARTS.CSV')
           TOFILE(IESR7TEST/AURPARTS)      
           RCDDLM[COLOR=red](*CRLF)[/color]

(I think you meant *CRLF, not *CLRF).



-- Francis
I'd like to change the world, but I can't find the source code.
 
They could be several other options necessary for completing the command succesfully.
It depends on your CSV-file: what is the record delimiter, field delimiter, string delimiter, decimal point, ... etc.

For example, I used in my CL-program this:
Code:
             CPYFRMIMPF FROMSTMF('/AMSLSP/amslsp_pf.csv') TOFILE(P600090V) +
                          MBROPT(*REPLACE) RCDDLM(*CRLF) STRDLM(*NONE) +
                          FLDDLM(';') DECPNT(*COMMA) RPLNULLVAL(*FLDDFT) +
                          IDCOL(*FROMFLD)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top