CPYFRMIMPF Issue with DDS

1780 pts.
Tags:
AS400 iseries
My code is below. I have a text file and its fixed.  So I created a DDS with these fields in it. I want to copy the text file into my DDS but all I get is blanks.  I can see where its adding the data but nothing is there.  If I query the file it shows records in it.. I just see them as all data blank.. Any ideas?
Thanks
CPYFRMIMPF +
             FROMSTMF('/Import/Data/Data.txt+
             ') TOFILE(CEIOH/FUELMAST) +
             MBROPT(*REPLACE) STMFLEN(468) +
             RCDDLM(*CRLF) DTAFMT(*FIXED) +
             STRDLM(*NONE) STRESCCHR(*NONE) +
             RMVBLANK(*NONE) FLDDFNFILE(MYLIB/QDDSSRC +
             DATA) RPLNULLVAL(*FLDDFT)


Software/Hardware used:
as/400

Answer Wiki

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

Discuss This Question: 8  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
  • TomLiotta
    If you are using DTAFMT(*FIXED) and STRDLM(*NONE) and STRESCCHR(*NONE), why are you using CPYFRMIMPF? Why don't you use CPYFRMSTMF? And if you're copying into a source file, why are you using CPYFRMIMPF instead of CPYFRMSTMF? And why would you have a streamfile with fixed-length of 468 if you're really intending to copy into a DDS source file? No DDS uses records that long. Working up an answer might be easier if those are made clear. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Tom I think Ron's trying to copy a fixed length text file into CEIOH/FUELMAST Since it's fixed length it has no delimiters. With it's structure described in FLDDFNFILE(MYLIB/QDDSSRC member DATA) apparently he's getting blank lines.. Ron - check the job log - it never helps but gives me time to think about it. It might have a list of error.s I usually copy this type of file to a flat file on the 400 then use CPYF with fmt *NOCHK to populate the target file. . Phil
    50,505 pointsBadges:
    report
  • philpl1jb
    So Tom's usually right, try CPYFRMSTMF The method I described only works with char fields and positive zoned fields. Not so useful. Phil
    50,505 pointsBadges:
    report
  • TomLiotta
    The CPYTOIMPF and CPYFRMIMPF commands are generally intended to provide the DB2 EXPORT and IMPORT functions that are found in DB2 on other platforms. As long as general DB2 database concepts are held in mind, their behavior can be a little more comprehensible. (They can definitely throw some curves at times.) Their purpose is somewhat described by this statement from CPYFRMIMPF help text:
    • The term import file is used to describe a file created for purposes of copying data between heterogeneous databases.
    But this question gets a little confused when the file name is QDDSSRC because it implies that this doesn't really involve a "database" file but a source file instead. A source file has some particular characteristics that might need to be taken into account. Maybe if the details of how data got into the oddly defined streamfile is given, an appropriate CPYFRMIMPF command can be built. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    I'd wonder first if this really is an "import" file. That is, how was it "exported"? Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Tom FLDDFNFILE(MYLIB/QDDSSRC member DATA) Isn't the place the data is imported from or to It's the member that contains a description of the file structure of the to file. Kinda like using an .fdf file when uploading in client access. Phil
    50,505 pointsBadges:
    report
  • TomLiotta
    ...Isn’t the place the data is imported from or to.. Sheesh! There you go again, forgetting to remind me to get new glasses! You really gotta do something about that memory. Ah, well... it definitely makes a lot more sense that way. I should have actually read your first response and noticed it then. Once something is misread, it's almost impossible to see it correctly until someone else points it out. The mind is marvelous, but it can foul up spectacularly. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Okay, so it should start with 'how was it "exported"?' I just see them as all data blank.. How are you viewing the file? Are all of the fields character fields? There are no numeric fields in FUELMAST? Does the number of blank records match the number of exported records? If you run under debug, do any hints show up? You will probably need to use STRDBG UPDPROD(*YES). You might also use CPYFRMIMPF FROMRCD(*FIRST 1) so that only one import record is processed. That will shorten any test runs. You might also use CPYFRMIMPF ERRRCDFILE(MYLIB/ERRF) so that any error records will be copied to an error file. After a test, check to see if any error records were logged. Tom
    125,585 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