|
You have a good point. Put it into the RPGLEHSPEC. Or in our case, your custom HSPEC that you /copy in. Start using modular code now and avoid this in the future. Let's say your company changes names. The /COPY is easier than a scan/replace. RON@CPUMMS.COM on 03/20/2000 11:31:47 AM Please respond to MIDRANGE-L@MIDRANGE.COM@Internet To: MIDRANGE-L@MIDRANGE.COM@Internet cc: Fax to: Subject: RE: Listing source member names Ron, Here a program we wrote to do that. We wrote it, but didn't use it. It was easier to put the statement in the RPGLEHSPEC data area. Then every program you recompile will have the copyright embedded in it. But heres the CL program anyway. I didn't include the RPG program that acutally embeds the code, but if you want it, let me know. PGM (&SRCIN &MBRIN) DCL VAR(&SRCIN) TYPE(*CHAR) LEN(20) DCL VAR(&SRCLIB) TYPE(*CHAR) LEN(10) DCL VAR(&SRCFIL) TYPE(*CHAR) LEN(10) DCL VAR(&SRCTYP) TYPE(*CHAR) LEN(10) DCL VAR(&MEMBR) TYPE(*CHAR) LEN(10) DCL VAR(&MBRIN) TYPE(*CHAR) LEN(10) DCL VAR(&TEXT) TYPE(*CHAR) LEN(50) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(512) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) CHGVAR &SRCFIL VALUE(%SST(&SRCIN 1 10)) CHGVAR &SRCLIB VALUE(%SST(&SRCIN 11 10)) /* MAKE SURE SOURCE FILE/LIBRARY EXISTS */ CHKOBJ OBJ(&SRCLIB/&SRCFIL) OBJTYPE(*FILE) MONMSG MSGID(CPF0000) EXEC(DO) RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) RETURN ENDDO DLTF QTEMP/WORKSOURCE MONMSG CPF0000 CRTSRCPF FILE(QTEMP/WORKSOURCE) RCDLEN(112) MONMSG CPF0000 /* GET THE FIRST SOURCE MEMBER TO UPDATE */ IF COND(&MBRIN *EQ '*ALL') THEN(DO) RTVMBRD FILE(&SRCLIB/&SRCFIL) MBR(*FIRSTMBR) + RTNMBR(&MEMBR) SRCTYPE(&SRCTYP) TEXT(&TEXT) MONMSG MSGID(CPF3049) EXEC(GOTO ENDPGM) GOTO FIRST ENDDO /* IF ONLY ONE MEMBER SPECIFIED, GET IT */ ELSE DO RTVMBRD FILE(&SRCLIB/&SRCFIL) MBR(&MBRIN) + RTNMBR(&MEMBR) SRCTYPE(&SRCTYP) TEXT(&TEXT) MONMSG MSGID(CPF3049) EXEC(GOTO ENDPGM) GOTO FIRST ENDDO LOOP: RTVMBRD FILE(&SRCLIB/&SRCFIL) MBR(&MEMBR *NEXT) + RTNMBR(&MEMBR) SRCTYPE(&SRCTYP) TEXT(&TEXT) MONMSG MSGID(CPF3049) EXEC(GOTO ENDPGM) FIRST: IF COND(&SRCTYP *NE 'RPGLE') THEN(GOTO + CMDLBL(LOOP)) OVRDBF FILE(INSOURCE) TOFILE(&SRCLIB/&SRCFIL) + MBR(&MEMBR) OVRDBF FILE(OUTSOURCE) TOFILE(QTEMP/WORKSOURCE) + MBR(&MEMBR) RMVM FILE(QTEMP/WORKSOURCE) MBR(&MEMBR) MONMSG MSGID(CPF0000) ADDPFM FILE(QTEMP/WORKSOURCE) MBR(&MEMBR) + SRCTYPE(RPGLE) TEXT(&TEXT) CALL ADDCPYST CPYSRCF FROMFILE(QTEMP/WORKSOURCE) + TOFILE(&SRCLIB/&SRCFIL) FROMMBR(&MEMBR) DLTOVR FILE(*ALL) IF COND(&MBRIN *EQ '*ALL') THEN(DO) GOTO LOOP ENDDO ENDPGM: ENDPGM -----Original Message----- From: owner-midrange-l@midrange.com [mailto:owner-midrange-l@midrange.com]On Behalf Of Klein Ron Sent: Saturday, March 18, 2000 8:51 AM To: 'MIDRANGE-L (E-mail) Subject: Listing source member names I have a need to update all of the source members with a copyright statement. I have looked and so far have not found how I can retrieve the members names of each member within the source file. I need to spin through each member and add a single line of code in a particular spot in the program. How do I retrieve that list, either to an out file or within a loop of a CL? TIA Ron +--- | 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 +--- +--- | 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.