AS400 Logical Files

75 pts.
Tags:
AS/400 Logical Programming
CPYF
Logical Files
i have copied a LF using CPYF command. When I use wrkobj LFname i can find the object but when i use wrkobj PFname(of the previous LF) object is not present. How can i copy PF and that particular LF when i give LF name in copy Command
ASKED: September 14, 2011  11:18 AM
UPDATED: March 31, 2012  4:37 PM

Answer Wiki

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

You can use CPYF command for copying data from one File(PF or LF) to other.
If the destination file doesnt exist, we can use option
<pre>Create file . . . . . . . . . . > *YES *NO, *YES </pre>

But, the resultant file will be PF.
Eg. If we are copying data from TESTLF to NEWFILE,
Then the resultant NEWFILE will be of type ‘PF’.

Instead of CPYF command you can use CRTDUPOBJ command for copying PF/LF
<pre> Create Duplicate Object (CRTDUPOBJ)

Type choices, press Enter.

From object . . . . . . . . . . Name, generic*, *ALL
From library . . . . . . . . . . Name, *LIBL, *CURLIB
Object type . . . . . . . . . . *ALL, *ALRTBL, *AUTL…
+ for more values
To library . . . . . . . . . . . *FROMLIB Name, *FROMLIB, *SAME…
New object . . . . . . . . . . . *OBJ Name, *OBJ, *SAME
From ASP device . . . . . . . . * Name, *, *CURASPGRP, *SYSBAS
To ASP device . . . . . . . . . *ASPDEV Name, *ASPDEV, *… </pre>

While Copying LF and corresponding PF, make sure you copy PF first and then LF.

Pradeep.

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

Minor addendum: when you use CRTDUPOBJ to duplicate the physical file, specify DATA(*NO). After using CRTDUPOBJ to duplicate the logical file(s), use CPYF to copy the data. This will ensure the duplicated logical files are based on the correct physical file.

Discuss This Question:  

 
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

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