ISeries Data Transfer VS CPYTOIMPF

35 pts.
Tags:
CPYTOIMPF
iSeries Data Transfer
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
ASKED: July 20, 2009  5:29 PM
UPDATED: July 23, 2009  4:17 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • StreetD
    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 pointsBadges:
    report
  • StreetD
    Phil, My CPYTOIMPF does not have the keyword NUMFLDPAD. Dave
    35 pointsBadges:
    report
  • StreetD
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following