Guild Companies, Inc.  
 
Midrange Guru - Tech Tips
OS/400 Edition
Volume 2, Number 40 - May 24, 2002

CRTDUPOBJ and the Library List

Dear Readers:

If you occasionally use the Create Duplicate Object (CRTDUPOBJ) command to duplicate an object somewhere in the library list, here's a tip for you.

Before V4R5, it was necessary to tell CRTDUPOBJ which library contained the object to be duplicated.

To duplicate an object that was somewhere in the library list, you had to use code like this:








/* V4R4 and before */

DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)     
                                             
RTVOBJD    OBJ(CUSTOMER) +                   
   OBJTYPE(*FILE) RTNLIB(&LIB)               
CRTDUPOBJ  OBJ(CUSTOMER) FROMLIB(&LIB) +     
   OBJTYPE(*FILE) +                          
   TOLIB(QTEMP) DATA(*YES)                   

The Retrieve Object Description (RTVOBJD) command is used to locate the library in which the object is stored.

As of V4R5, that is no longer necessary. IBM added two special values--*LIBL and *CURLIB--to the FROMLIB parameter.

/* V4R5 and after */

CRTDUPOBJ  OBJ(CUSTOMER) FROMLIB(*LIBL) + 
   OBJTYPE(*FILE) +                          
   TOLIB(QTEMP) DATA(*YES)

-- David

Sponsored By
TRAMENCO

iSeries and AS/400 Connection Conference Extends Savings Deadline!

Good News!

There is still time to join your colleagues at the ultimate iSeries and AS/400 conference this June 16 – 19, and save $200 in the process.

Sign up for the iSeries and AS/400 Connection Conference in beautiful Naples, Florida, before June 7 and the standard registration is only $1,395.

To register, or to view the complete course agenda, visit www.tramenco.com/naples .

But you have to hurry! Time is running out and hotel rooms are filling up fast.

Reserve your spot today.

THIS ISSUE
SPONSORED BY:
WorksRight Software
Tramenco
BACK ISSUES
TABLE OF CONTENTS
Creating a User-Defined Function to Convert Legacy Dates
CRTDUPOBJ and the Library List
Reader Feedback and Insights: Repetitive Compiler Options
  Newsletters | Subscribe | Advertise | About Us | Contact | Search | Home  
  Last Updated: 5/23/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.