CPYF in arrival sequence

pts.
Tags:
AS/400
DB2 Universal Database
Anyone know a quick and dirty to copy data from a keyed physical file to another physical in arrival sequence in a CLP program? I can't find a native os/400 command that will do it.

Answer Wiki

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

Try messing with the ACCPTH(*ARRIVAL) parameter on OPNDBF.

OPNDBF FILE(file) OPTION(*INP) ACCPTH(*ARRIVAL)
OVRDBF FILE(file) SHARE(*YES)
CPYF…
DLTOVR FILE(file)
CLOF FILE(file)

I’ve not actually tried this but give it a go. CPYF does not ignore overrides so it should use the shared access path already opened in arrival sequence by the OBNDBF command.

==========================================================

CPYF FROMRCD(1) FROMKEY(*NONE)

Tom

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
  • Dasturg
    Thanks for the suggestion but a no go. CPYF must ignore the override. Looks like this would be an option with CPYF. I guess this is why IBM suggests making your physicals non-keyed. I know the OS can do this because when you do a CRTDUPOBJ DATA(*YES) on a physical file, the data in the new physical is in arrival sequence. Thanks again.
    0 pointsBadges:
    report
  • PGMBOB
    SQL insert into newfile select * from oldfile order by rrn(oldfile) 
    990 pointsBadges:
    report
  • Rickmcd
    In the CPYF command there is a Variable from Record number or starting point. The default is *START if you change to 1 it copies the file sequentially and not keyed order
    1,595 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