|
The following CLP example takes two parameters: the first is an input and represents the library name, the second is an output holding the size of the library. You may find that using this API approach is significantly faster than DSPLIB *PRINT. I threw this example together and it appears to work, but it has not been tested much at all. Hope it helps, Bruce PGM PARM(&LIBNAME &LIBSIZE) DCL VAR(&LIBNAME) TYPE(*CHAR) LEN(10) DCL VAR(&LIBSIZE) TYPE(*DEC) LEN(15 0) DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(256) DCL VAR(&RCVVARSIZ) TYPE(*CHAR) LEN(4) + VALUE(X'00000100') DCL VAR(&ATTRIBS) TYPE(*CHAR) LEN(8) + VALUE(X'0000000100000006') /* Define one + attribute of value 6 (library size) */ DCL VAR(&ERRCOD) TYPE(*CHAR) LEN(4) + VALUE(X'00000000') /* Error code = 0 so + exception will be returned */ DCL VAR(&ONE) TYPE(*CHAR) LEN(4) + VALUE(X'00000001') /* Binary 1 */ DCL VAR(&SIZE) TYPE(*DEC) LEN(15 0) DCL VAR(&MULT) TYPE(*DEC) LEN(15 0) CALL PGM(QLIRLIBD) PARM(&RCVVAR &RCVVARSIZ + &LIBNAME &ATTRIBS &ERRCOD) IF COND((%SST(&RCVVAR 1 4) = %SST(&RCVVAR 5 4)) + *AND (%SST(&RCVVAR 9 4) = %SST(&RCVVAR 13 + 4)) *AND (%SST(&RCVVAR 9 4) = &ONE)) + THEN(DO) /* Make sure the requested + information was returned */ CHGVAR &SIZE %BIN(&RCVVAR 29 4) CHGVAR &MULT %BIN(&RCVVAR 33 4) CHGVAR &LIBSIZE (&SIZE * &MULT) IF (%SST(&RCVVAR 37 1) = '0') THEN(DO) SNDPGMMSG + MSG('Incomplete library information') + TOPGMQ(*EXT) ENDDO ENDDO ENDPGM > >What I am trying to do is simple as retriving the total field of the >QPDSPLIB to make a command that gives the space occupied by a library or >more. That is instead of always execute the dsplib LIB *print, and see >the total space accupied by the library (using wrksplf) I want to be >more quickly and simply run a CMD to return that. >Sorry but I was a typing error in the DSPFD . > >Silvio Santos. > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. 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.