View Full Version : Check library existence on other AS/400
Guest.Visitor
01-01-1995, 02:00 AM
What's a good way to programatically detect the presence of a specific library on another AS/400? I think I could use RUNRMTCMD and run a CL program on the other AS/400 which does a DSPOBJD into out *OUTFILE for the library and then use DDM to check the outfile...but this way seems long winded. Thanks. Chris
trevor.lazarus@ssa.gov
05-07-1999, 12:15 PM
On Friday, May 07, 1999, 06:57 AM, Chris Ringer wrote: What's a good way to programatically detect the presence of a specific library on another AS/400? I think I could use RUNRMTCMD and run a CL program on the other AS/400 which does a DSPOBJD into out *OUTFILE for the library and then use DDM to check the outfile...but this way seems long winded. Thanks. Chris How about using CHKOBJ on the remote system to check for the library. Then MONMSG should tell you quickly if its there. Trevor Lazarus <a > href="http://www.compuware.com">Compuware</a>
Guest.Visitor
05-07-1999, 01:15 PM
On Friday, May 07, 1999, 12:15 PM, Trevor Lazarus wrote: How about using CHKOBJ on the remote system to check for the library. Then MONMSG should tell you quickly if its there. Are you saying to put the MONMSG after the RUNRMTCMD and use CHKOBJ as the command in RUNRMTCMD? Chris
Guest.Visitor
05-07-1999, 01:21 PM
On Friday, May 07, 1999, 06:57 AM, Chris Ringer wrote: What's a good way to programatically detect the presence of a specific library on another AS/400? I think I could use RUNRMTCMD and run a CL program on the other AS/400 which does a DSPOBJD into out *OUTFILE for the library and then use DDM to check the outfile...but this way seems long winded. Thanks. Chris Chris, I have not done this for a while, but I am pretty sure that I have used CHKOBJ via RUNRMTCMD to determine whether an object exists on the target system.
Guest.Visitor
05-07-1999, 01:48 PM
On Friday, May 07, 1999, 01:15 PM, Chris Ringer wrote: On Friday, May 07, 1999, 12:15 PM, Trevor Lazarus wrote: How about using CHKOBJ on the remote system to check for the library. Then MONMSG should tell you quickly if its there. Are you saying to put the MONMSG after the RUNRMTCMD and use CHKOBJ as the command in RUNRMTCMD? Chris Chris, You won't be able to trap the actual CPF9801 error, but if you specify CHKOBJ OBJ(QSYS/LIB) OBJTYPE(*LIB) AUT(*EXIST), you can be pretty sure what has caused the problem. David Morris
daly.michael@verizon.net
05-10-1999, 12:11 PM
My suggestion would be to create a DDM file in QTEMP and point it to a bogus file in the library in question on the remote system. Then try a CPYF from the local AS/400 to the remote through the DDM file. If the library doesn't exist, this is what your joblog will look like: <pre>> CRTDDMF FILE(QTEMP/COMPANP) RMTFILE(remote-lib-name/COMPANP) RMTLOCNAME(serial#) Ownership of object COMPANP in QTEMP type *FILE changed. File COMPANP created in library QTEMP.> CPYF FROMFILE(local-lib-name/COMPANP) TOFILE(QTEMP/COMPANP) MBROPT(*REPLACE) Remote database job started. DDM object COMPANP in QTEMP uses remote object remote-lib-name/COMPANP. Library QTEMP not found. Cannot assign or release DDM file(s). File COMPANP in QTEMP not available. Copy command ended because of error.</pre> If the library does exist, you'll get a file not found error because we pointed our DDMF to a bogus file name. MichaelD<hr><a > href="http://www.freshpoint.com"><imgsrc="http://www.freshpoint.com/graphics/f ooterlogo.GIF"border="0" width="162" height="48"></a><font > color="#408080"> The Fresh Produce Experts Michael Daly, Sr. P/A (972) 392-8169</font>
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.