Question

  Asked: May 7 2008   5:04 PM GMT
  Asked by: Klw


CPYTOIMPF - Physical file to IFS, get imbedded blanks


CPYTOIMPF, DDS, IFS

I have a physical file with the following fields.

(field - attribute - sample content)

FILL01 - 1A - blank
KEY - 8A - AAPCTINV
LENGTH - 2S 0 - 60
TEXT - 60 A - 8028038

When looking at the file using DSPPFM, the info =
AAPCTINV608028038
Note, it has 1 space at the begining

Using the following

CPYTOIMPF FROMFILE(mylib/myfile) TOSTMF('/folder1/folder2/myfile.txt') STMFCODPAG(*STDASCII) RCDDLM(*CRLF) DTAFMT(*FIXED)

When I look at the file on the IFS it shows as below:
AAPCTINV60 8028038
The leading space is kept - but for some reason, there is a new space in there, between the LENGTH field and the TEXT field. I suspect it has to do with the LENGTH field being defined as signed?
I don't care however - I want the data to come across with the same field placements

FILL01 in column 1-1
KEY in column 2-9
Length in column 10-11
Text in column 12-60

Is there a parameter on the CPYTOIMPF command that controls this? or should I use a different command entirely - which I am open to, I want the easiest way possible to copy a DDS described file to the IFS.

Thanks

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0




Hi,

If you want the data in exactly the same format I suggest trying CPYTOSTMF.

Regards,

Martin Gilbert.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register