Why am I having such a problem copying a file.

385 pts.
Tags:
AS/400 Data File
RPGLE
RPGLE Training
Trying to copy a smaller file 89 bytes and one field less file to a 96 byte file that has one more field. Trying Cpyf weblibl/wcur test01/wcur mbropt(*replace) fmtopt(*map *dr op) Get a return message of 29767 records copied but receiving file is empty. Where did they the records goto?

Answer Wiki

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

could there be more than one member in the to file?
Use dspfd to display member list and number of records per member.

Discuss This Question: 23  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
    How many members are in both files? When you say "receiving file is empty", does that mean you queried the file? Ran DSPFD? DSPPFM? Ran a program? Were errors reported during the copy? Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Also, any chance the defaults have been changed for CPYF? Tom
    125,585 pointsBadges:
    report
  • djac
    Did you check your joblog after running the copy? Try setting logging to maximum and run the copy again to see if there are any relevant errors.
    900 pointsBadges:
    report
  • nitzinger
    I looked at file using DBU and using pdm 5 for display. Shows one line with blanks and zeroes. DSPFD rates up there with WRKOBJ as being all most worthless. Anyway DSPFD when ran, displays at the very end of the listing display - total number of members = 1, total records = 0, total deleted = 0, and total of member sizes = 32768 as would be expected I would think.
    385 pointsBadges:
    report
  • nitzinger
    Cpyf webprddt7/wbmscur mbmtest01/wmbscur mbropt(*replace) fmtopt(*map *drop) Member WBMSCUR at maximum size. (I) ? I Size of member WBMSCUR increased 10002 increments. 29773 records copied from member WBMSCUR. After DSPJOBLOG this what I find.
    385 pointsBadges:
    report
  • Teandy
    Are there any selects or omits on file mbmtest01/wmbscur? In other words, is the file set up to show records that only meet certian conditions?
    5,860 pointsBadges:
    report
  • nitzinger
    No selects or omits. None of the defaults have been changed that I know. This an attempt to copy the production file to a test file in my library. The prod file and the test file are the same except the new test file has an extra field and a extra four bytes for the new field. I deleted the old test file, recompiled the new test file and then try the copy. Thanks
    385 pointsBadges:
    report
  • TomLiotta
    Anyway DSPFD when ran, displays at the very end of the listing display - total number of members = 1... I assume that that's the target file. "Worthless"? Well, since it's essentially factual data, it must be trusted more than a 3rd-party tool. If DSPFD (and/or the APIs over which it's built) can't provide info, then no 3rd-party tool will do better. What does the same area of DSPFD show for the source file? It really shouldn't matter, but it's worth having the factual foundation. As for CPYF, if you prompt it, press <F9> and scroll to the final panel. What are the defaults for the last two parameters, ERRLVL() and COMPRESS()? It looks like COMPRESS(*YES) must be there, but ERRLVL()? And did you specify an ERRLVL()? Tom
    125,585 pointsBadges:
    report
  • Wlakesearcher
    Could there be more than 2 versions of your file on the system? When you are using dspfd to look at the number of records, are you qualifying the file to the library webprddt7, or is it *libl? What library are you looking at when you use VIEW or DSPFD?
    100 pointsBadges:
    report
  • nitzinger
    Test file DSPFD Source Creation Last Change Deleted Member Size Type Date Date Time Records Records WBMSCUR 32768 11/19/09 11/19/09 11:57:20 0 0 Text: Current Price Catalog file Total number of members . . . . . . . . . : 1 Total number of members not available . . : 0 Total records . . . . . . . . . . . . . . : 0 Total deleted records . . . . . . . . . . : 0 Total of member sizes . . . . . . . . . . : 32768 Prod file (the sending file of the cpyf command) Source Creation Last Change Deleted Member Size Type Date Date Time Records Records WBMSCUR 4415488 09/18/02 11/19/09 12:01:14 29774 83 Text: Current file Total number of members . . . . . . . . . : 1 Total number of members not available . . : 0 Total records . . . . . . . . . . . . . . : 29774 Total deleted records . . . . . . . . . . : 83 Total of member sizes . . . . . . . . . . : 4415488 And my cpyf file defaults are: Errors allowed . . . . . . . . . ERRLVL 0 Compress out deleted records . . COMPRESS *YES
    385 pointsBadges:
    report
  • nitzinger
    I'm using fully quafity name ie. : dspfd mbmtest01/wbmscur
    385 pointsBadges:
    report
  • TomLiotta
    @Nitzinger: Looks good for the FDs and the command. Next action is to log on to a fresh session, CALL QCMD, press <F10> for detailed messages and run the CPYF. When it finishes, copy/paste the list showing the command request and the resulting messages. This shows us precisely what the effect is on your system (which may be different from ours.) Tom
    125,585 pointsBadges:
    report
  • ASWDEVELOPER
    just a wild shot here, but aren't you copying a file with fewer fields to a larger file ? ... if you had MORE fields in the from file, i could see the need for "DROP" ... but you have FEWER fields ... so maybe your field names are not the same ? ... that would account for all your data being "dropped" ... you inferred that the data layout of the first 89 bytes is the same in both files ....so instead of *DROP try using "NOCHK" ...
    405 pointsBadges:
    report
  • philpl1jb
    Member WBMSCUR at maximum size. (I) ? I Size of member WBMSCUR increased 10002 increments Change the to file to member size *nomax .. or at least 30000 .. Still reaching on this. Phil
    49,950 pointsBadges:
    report
  • nitzinger
    Here are the results after trying the CPYF 3 > CPYF WEBPRDDT7/WBMSCUR MBMTEST01/WMBSCUR MBROPT(*REPLACE) FMTOPT(*MAP *DROP) Member WBMSCUR at maximum size. (I) ? I Size of member WBMSCUR increased 10002 increments. 29782 records copied from member WBMSCUR. 3 > dsppfm mbmtest01/wbscur File WBSCUR in library MBMTEST01 not found. 3 > dsppfm mbmtest01/wbmscur 3 > call qcmd
    385 pointsBadges:
    report
  • Splat
    3 > CPYF WEBPRDDT7/WBMSCUR MBMTEST01/WMBSCUR MBROPT(*REPLACE) FMTOPT(*MAP
    *DROP)
    Member WBMSCUR at maximum size. (I)
    ? I
    Size of member WBMSCUR increased 10002 increments.
    29782 records copied from member WBMSCUR.
    3 > dsppfm mbmtest01/wbscur
    File WBSCUR in library MBMTEST01 not found.
    3 > dsppfm mbmtest01/wbmscur
    3 > call qcmd
    Pardon me for pointing out the obvious, but you're copying data to file WBMSCUR but looking for file WBSCUR. If that's not a typo, it might indicate your problem.
    7,235 pointsBadges:
    report
  • Teandy
    Try this: Cpyf weblibl/wcur test01/wcur mbropt(*replace) fmtopt(*nochk)
    5,860 pointsBadges:
    report
  • nitzinger
    Nice advise I thought FMTOPT(*nochk) might work but same result. Thanks
    385 pointsBadges:
    report
  • philpl1jb
    What type of field did you add? Did you add the field using SQL create or alter table or did you change the dds Is the new field part of the primary key or a unique key Does the new field have a default value, does it allow nulls? Phil
    49,950 pointsBadges:
    report
  • TomLiotta
    3 > CPYF WEBPRDDT7/WBMSCUR MBMTEST01/WMBSCUR MBROPT(*REPLACE) FMTOPT(*MAP
    *DROP)
    ...
    3 > dsppfm mbmtest01/wbmscur
    There is a discrepancy, though not quite the one mentione above. The TOFILE is MBMTEST01/WMBSCUR. The DSPPFM is mbmtest01/wbmscur. "WMB" v. "wbm". Just in case it wasn't a typo. (The first dsppfm was a definite typo that you corrected.) Tom
    125,585 pointsBadges:
    report
  • nitzinger
    I defined the new field 'SPPMBQ 4S 0 COLHDG('MIN' 'BUY QTY')' It not a key or part of the key. I modify the DDS to added the new field. No default value. Took whatever is the default for 'null values'.
    385 pointsBadges:
    report
  • CharlieBrowne
    Is the new file being Journaled? If yes, is it a commitment control problem? If no, do a STRJRNPF on the output file. Then look at the Journal to see what happened to the records.
    41,380 pointsBadges:
    report
  • philpl1jb
    So I did that, added your field to the end of a file dds, compiled and copied the original file to it with map and dorp. Got a message about differences in the buffer length and it copied the data putting 0 in the new field. Odd that you didn't get the buffer length message...if you're coping it to the right file.
    49,950 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