35 pts.
 ISeries Data Transfer VS CPYTOIMPF
When transfering data from the AS400 to a PC as a text file using the iSeries transfer, the numeric values are right justified and this is what I need. I am trying to setup a CL that will do this with out any user interaction. But whenever I try to do this on the AS400 using CPYTOIMPF or CPYTOSTMF the numeric values are left justified. How can I get around this issue without having the user upload these files every week? Thanks Dave

Software/Hardware used:
ASKED: July 20, 2009  5:29 PM
UPDATED: July 23, 2009  4:17 PM

Answer Wiki:
StreetD I'm not sure what your client access download looks like - perhaps a few lines would help me But I'm guessing you want a fixed record length - no field delimiters and blanks on numeric. So you want to change your CPYTOIMPF as follows. CPYTOIMPF DTAFMT *FIXED NUMFLDPAD *blank Phil StreetD So .. try NUMFLDPAD *blank That should do what you want .. leading blanks on numeric fields. Phil ----------------------- StreetD Did setting the NumFldPad value to it? Phil ------------------------ **************************************************** Thanks for the feedback - NUMFLDPAD is a v6r1 feature And now we know why it was added. Until your upgrade ... 1. If your program is creating the download file 1.1. Change the numeric fields to char 1.2. Use appropriate %EDITC to right justify the data. 2. Else Write a small program to read each record from the download file and write it to a second file with char fields instead on numeric fields using %EDITC to right justify the data. Then USE CPYTOIMPF to copy the data from the new file. Phil ***************************************************** Dave That's great Phil
Last Wiki Answer Submitted:  July 23, 2009  4:17 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Phil,

This is the CPYTOIMPF I am using,

CPYTOIMPF FROMFILE(LIB/FILE &MLNAME) +
TOSTMF(‘/payfiles/PAY.TXT’) +
MBROPT(*REPLACE) STMFCODPAG(*STMF) +
RCDDLM(*CRLF) DTAFMT(*FIXED) NULLIND(*NO)

As for the client access it is the IBM iSeries access for Windows

Just a transfer of a file member to a ASCII text file.

 35 pts.

 

Phil,

My CPYTOIMPF does not have the keyword NUMFLDPAD.

Dave

 35 pts.

 

Phil,

Thank you for your help. We will be going the V6R1 next week. We have V6R1 on our one system, so I was able to try the new CPYTOIMPF using the keyword NUMFLDPAD *BLANK. The file is in the correct format for our client.

Dave

 35 pts.