|
Hi Steve, I knew it was simple. And I'm unforgivable because I learnt about that a few months ago. Here is my new CL : PGM DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&TEXTE) TYPE(*CHAR) LEN(20) DCLF FILE(SAVES/LSTLIB) DSPOBJD OBJ(*ALLUSR) OBJTYPE(*LIB) OUTPUT(*OUTFILE) + OUTFILE(SAVES/LSTLIB) LECTURE: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(FIN)) IF COND(%SST(&ODOBNM 1 3) *EQ 'SAV') THEN(GOTO + CMDLBL(LECTURE)) CRTSAVF FILE(SAVES/&ODOBNM) MONMSG MSGID(CPF7302) SAVCHGOBJ OBJ(*ALL) LIB(&ODOBNM) DEV(*SAVF) + SAVF(SAVES/&ODOBNM) CLEAR(*ALL) SAVACT(*LIB) MONMSG MSGID(CPF0001 CPF3702) RECEIVE: RCVMSG WAIT(1) MSGID(&MSGID) IF COND(&MSGID *EQ 'CPC3708') THEN(GOTO + CMDLBL(REDEL)) IF COND(&MSGID *EQ ' ') THEN(GOTO + CMDLBL(LECTURE)) IF COND(&MSGID *NE 'CPC3723') THEN(GOTO + CMDLBL(RECEIVE)) GOTO CMDLBL(LECTURE) REDEL: DLTF FILE(SAVES/&ODOBNM) GOTO CMDLBL(LECTURE) FIN: ENDPGM Hoping all cases are tested. Thank's for help. JC -----Message d'origine----- De : Steve Landess [mailto:sjl_abc@xxxxxxxxxxx] Envoyé : samedi 25 septembre 2004 17:34 À : Midrange Systems Technical Discussion Cc : MITTELHEISSER Jean Claude Objet : Re: Writing a CL to save changed objects from *ALLUSR libs Jean Claude - After the SAVCHGOBJ command, use RCVMSG (in a loop) to receive messages and check to see if the CPC3708 message is issued. If so, delete the save file, since it is empty... Steve Landess Austin, Texas (512) 423-0935 ----- Original Message ----- From: "MITTELHEISSER Jean Claude" <> To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx> Sent: Saturday, September 25, 2004 9:13 AM Subject: Writing a CL to save changed objects from *ALLUSR libs Hi all, I would like to make a SAVCHGOBJ on *ALLUSR libraries to disk, not to tape. Goal is to send it to a backup system. To save into files, I have to create a file per library because SAVCHGOBJ *ALLUSR doesn't work when saving on file. So I wrote a CL that first lists *ALLUSR libraries, then creates a file with the name of the library to save and then saves. Here it is : PGM DCLF FILE(SAVES/LSTLIB) DSPOBJD OBJ(*ALLUSR) OBJTYPE(*LIB) OUTPUT(*OUTFILE) + OUTFILE(SAVES/LSTLIB) LECTURE: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(FIN)) IF COND(%SST(&ODOBNM 1 3) *EQ 'SAV') THEN(GOTO + CMDLBL(LECTURE)) CRTSAVF FILE(SAVES/&ODOBNM) MONMSG MSGID(CPF7302) SAVCHGOBJ OBJ(*ALL) LIB(&ODOBNM) DEV(*SAVF) + SAVF(SAVES/&ODOBNM) CLEAR(*ALL) SAVACT(*LIB) MONMSG MSGID(CPF0001 CPF3702) GOTO CMDLBL(LECTURE) FIN: ENDPGM It works fine, but I would like to know if something has been saved into file to delete it if not. I see 2 ways : - When SAVCHGOBJ saves some objects, completion message CPC3723 is sent, and when nothing is saved, message CPC3708 is sent. But basic MONMSG doesn't work. - DLTF save file before creating it and test if file is empty after SAVCHGOBJ. But how ? It must be so simple, but I have no idea. Some idea ? Thanks. Best Regards. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
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.