|
Thanx Peter .... I finally stumbled on a CL solution too... DSPLNK ... Not very elegant, but it seems to work.... In this example I'm testing for a file in directory /PRDLAW/INBOUND/GL165/ with an extension of .csv. If it exists I get a report that I then delete. If it doesn't exist, I get escape message CPFA0A9... /* BUILD THE FILENAME2 STRING */ CHGVAR VAR(&FILENAME2) VALUE(' ' *TCAT + '''/PRDLAW/INBOUND/GL165/' *TCAT + &FILENAME *TCAT '.csv''' *TCAT ' ') /* CHECK TO SEE IF THE FILE EXISTS */ DSPLNK OBJ(&FILENAME2) OUTPUT(*PRINT) DETAIL(*NAME) + DSPOPT(*ALL) MONMSG MSGID(CPFA0A9) EXEC(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('File ' *TCAT &FILENAME2 *BCAT 'not found. Did + you upload it?') MSGTYPE(*ESCAPE) ENDDO DLTSPLF FILE(QSYSPRT) SPLNBR(*LAST) MONMSG MSGID(CPF0000) Kenneth -----Original Message----- From: Peter Dow [mailto:pcdow@yahoo.com] Sent: Wednesday, June 13, 2001 2:46 PM To: MIDRANGE-L@midrange.com Subject: Re: CHKOBJ for an IFS file Hi Ken, Try the access() UNIX-type API. It will let you check forthe existence of the file and (if required) whether you have specific authorities to that file. You pass it a null-terminated string with the path & filename as one parameter, and an integer that tells it what you want to test for. For documentation, try: http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/info/apis/access.h tm hth, Peter Dow Dow Software Services, Inc. 909 425-0194 voice 909 425-0196 fax ----- Original Message ----- From: "Graap, Ken" <keg@nwnatural.com> To: "'Midrange'" <midrange-l@midrange.com> Sent: Tuesday, June 12, 2001 8:36 AM Subject: CHKOBJ for an IFS file > Does anyone know of a command or technique, that could be used to check for > the existence of an IFS file like CHKOBJ can check for the existence of a DB > file? > > Kenneth > > **************************************** > Kenneth E. Graap > IBM Certified Specialist > AS/400e Professional System Administrator > NW Natural (Gas Services) > keg@nwnatural.com > Phone: 503-226-4211 x5537 > FAX: 603-849-0591 > **************************************** > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.