20 pts.
 AS400 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

Software/Hardware used:
ASKED: September 14, 2011  11:18 AM
UPDATED: March 31, 2012  4:37 PM

Answer Wiki:
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.
Last Wiki Answer Submitted:  September 16, 2011  2:53 pm  by  deepu9321   3,520 pts.
All Answer Wiki Contributors:  deepu9321   3,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _