|
Try this: /*-------------------------------------------------------------------*/ /* Program: CHKIFSOBJC (CPP program for CHKIFSOBJ command) */ /* Description: Determines the existence of an object in the IFS */ /* file system - written by David Leland. */ /* Provided by Club Tech Programming Tips Newsletter */ /* (from NEWS/400 Magazine Issue 22 July 5, 2000) */ /*-------------------------------------------------------------------*/ PGM PARM(&PARM) DCL VAR(&PARM) TYPE(*CHAR) LEN(256) DCL VAR(&RTNVALINT) TYPE(*CHAR) LEN(4) DCL VAR(&RTNVAL) TYPE(*CHAR) LEN(2) DCL VAR(&PATH) TYPE(*CHAR) LEN(100) DCL VAR(&BUF) TYPE(*CHAR) LEN(4096) CHGVAR VAR(&PATH) VALUE(&PARM *TCAT &NULL) CALLPRC PRC('stat') PARM(&PATH &BUF) + RTNVAL(%BIN(&RTNVALINT 1 4)) CHGVAR VAR(&RTNVAL) VALUE(%BIN(&RTNVALINT)) IF COND(&RTNVAL *NE '00') THEN(SNDPGMMSG + MSGID(CPF9897) MSGF(QCPFMSG) + MSGDTA('Object ' || &PARM |< ' not + found.') MSGTYPE(*ESCAPE)) /*-------------------------------------------------------------------*/ /* Command: CHKIFSOBJ */ /* Command PP: CHKIFSOBJC */ /* Description: Provided by Club Tech Programming Tips Newsletter */ /* (from NEWS/400 Magazine Issue 22 July 5, 2000) */ /*-------------------------------------------------------------------*/ CMD PROMPT('Validate an IFS Object') PARM KWD(OBJECT) TYPE(*PNAME) LEN(256) MIN(1) + EXPR(*YES) PROMPT('IFS object') ENDPGM > > c.chambers@xxxxxxx wrote: > > > e.g. How does one validate the existence of an Object in > the same way that CHKOBJ does. > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.