× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Listing source member names
  • From: "Ron Hawkins" <RON@xxxxxxxxxx>
  • Date: Mon, 20 Mar 2000 07:52:11 -0800
  • Importance: medium

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
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.