 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Programs using a PF</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 22:12:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: woodengineer</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/#comment-97060</link>
		<dc:creator>woodengineer</dc:creator>
		<pubDate>Mon, 26 Sep 2011 16:53:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-97060</guid>
		<description><![CDATA[About three years ago Roger Stein wrote an article in SystemiNews where he published a handy utility which does what you want.

The article is probably still available in the archives.]]></description>
		<content:encoded><![CDATA[<p>About three years ago Roger Stein wrote an article in SystemiNews where he published a handy utility which does what you want.</p>
<p>The article is probably still available in the archives.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yorkshireman</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/#comment-97048</link>
		<dc:creator>yorkshireman</dc:creator>
		<pubDate>Mon, 26 Sep 2011 09:20:46 +0000</pubDate>
		<guid isPermaLink="false">#comment-97048</guid>
		<description><![CDATA[Roughly, you can look through source code

but you may not have all of it


You can run DSPPGMREF over all objects on the system and capture the result
(this is what X-analysis does)  

You can RTV files used from queries 

You could take a view on whether functionality like DFU or WRKDBF or SQL is going to alter the file 

You could *know* if  .NET functions et al  have any access 

and
You can examine journal entries - because this is what *really* causes changes - but keep doing it, because year-end and housekeeping routines have a habit of popping up unexpectedly long after you think the work is done.  


Why do you need to know? - perhaps the context would help limit the task.]]></description>
		<content:encoded><![CDATA[<p>Roughly, you can look through source code</p>
<p>but you may not have all of it</p>
<p>You can run DSPPGMREF over all objects on the system and capture the result<br />
(this is what X-analysis does)  </p>
<p>You can RTV files used from queries </p>
<p>You could take a view on whether functionality like DFU or WRKDBF or SQL is going to alter the file </p>
<p>You could *know* if  .NET functions et al  have any access </p>
<p>and<br />
You can examine journal entries &#8211; because this is what *really* causes changes &#8211; but keep doing it, because year-end and housekeeping routines have a habit of popping up unexpectedly long after you think the work is done.  </p>
<p>Why do you need to know? &#8211; perhaps the context would help limit the task.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/#comment-96995</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 23 Sep 2011 21:52:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-96995</guid>
		<description><![CDATA[I&#039;ve started running a set of jobs similar to what NullFields describes on various systems. I also run jobs to create lists of all source members and lists of all program and service program modules. A few years back, I&#039;d run them over weekends (or when I chose to repopulate the files by submitting them manually). Nowadays, systems seem to handle running the jobs every night.

It&#039;s handy being able to run simple SQL statements to locate where all copies of a source member of a given name exist or where any programs are that have a particular module bound in.

If I can get a system to do my work for me, I&#039;m all in favor.

Tom]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve started running a set of jobs similar to what NullFields describes on various systems. I also run jobs to create lists of all source members and lists of all program and service program modules. A few years back, I&#8217;d run them over weekends (or when I chose to repopulate the files by submitting them manually). Nowadays, systems seem to handle running the jobs every night.</p>
<p>It&#8217;s handy being able to run simple SQL statements to locate where all copies of a source member of a given name exist or where any programs are that have a particular module bound in.</p>
<p>If I can get a system to do my work for me, I&#8217;m all in favor.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nullfields</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/#comment-96984</link>
		<dc:creator>nullfields</dc:creator>
		<pubDate>Fri, 23 Sep 2011 14:22:56 +0000</pubDate>
		<guid isPermaLink="false">#comment-96984</guid>
		<description><![CDATA[For a quick look, DSPPGMREF will work.  I&#039;ve written this program/command combo that builds the program reference file for all the libraries you specifiy.  Put it on the schedule to run regularly, and you have a table that is always available to answer your queries:

Command:
&lt;pre&gt;

CMD        PROMPT(&#039;Update Program References&#039;)              
PARM       KWD(REFLIB) TYPE(*NAME) LEN(10) PROMPT(&#039;Library +
             where Ref. DB Created&#039;)                        
PARM       KWD(LIBS) TYPE(*NAME) LEN(10) MIN(1) MAX(250) +  
             PROMPT(&#039;Library name&#039;)                         

&lt;/pre&gt;

The program behind the command:

&lt;pre&gt;

            PGM        PARM(&amp;BCLIB &amp;LIBSTOREF)                  
                                                                
DECLARES:                                                       
            /* Lib where file exists     */                     
            DCL        VAR(&amp;BCLIB) TYPE(*CHAR) LEN(10)          
            /* Libs containing objects to reference(up to 30) */
            DCL        VAR(&amp;LIBSTOREF) TYPE(*CHAR) LEN(2502)    
                                                                
            /* Current list item number */                      
            DCL        VAR(&amp;CURNBR) TYPE(*DEC) LEN(5 0)         
            /* Current library being processed */               
            DCL        VAR(&amp;CURLSTITM) TYPE(*CHAR) LEN(100)     
            /* Library being worked */                          
            DCL        VAR(&amp;LIB2WORK) TYPE(*CHAR) LEN(10)       
                                                                
            /* Work variables for display */                    
            DCL        VAR(&amp;LISTCOUNT) TYPE(*DEC) LEN(5 0)      
            DCL        VAR(&amp;WORK22) TYPE(*CHAR) LEN(22)         
            /*Build the reference file new each time */                      
            CLRPFM     FILE(&amp;BCLIB/PGMREFS)                                  
                                                                             
            /* Display in job log the number of list items being processed */
            CHGVAR     VAR(&amp;LISTCOUNT) VALUE(%BIN(&amp;LIBSTOREF 1 2))           
            EDTVAR     CHROUT(&amp;WORK22) NUMINP(&amp;LISTCOUNT)                    
            SNDPGMMSG  MSG(&amp;WORK22 &#124;&lt; &#039; Libraries in the list&#039;)              
                                                                             
            DOWHILE    COND(&amp;CURNBR *GE 0)                                   
            /* Extract list for processing */                                
               EXTLST     LIST(&amp;LIBSTOREF) ELMLEN(10) ELEMENT(&amp;CURLSTITM) +  
                            CURNBR(&amp;CURNBR)                                  
                                                                             
               IF         COND(&amp;CURNBR *GE 0) THEN(DO)                       
                                                                             
                  CHGVAR     VAR(&amp;LIB2WORK) VALUE(%SST(&amp;CURLSTITM 1 10))     
                                                                             
                  SNDPGMMSG  MSG(&#039;Processing... &#039; &#124;&#124; &amp;LIB2WORK)              
                  DSPPGMREF  PGM(&amp;LIB2WORK/*ALL) OUTPUT(*OUTFILE) +          
                               OBJTYPE(*ALL) OUTFILE(&amp;BCLIB/PGMREFS) +       
                               OUTMBR(*FIRST *ADD)                           
                                                                             
ERRMSG:           MONMSG     MSGID(CPF3064 CPF3033 CPF3034) EXEC(SNDMSG +    
                               MSG(&#039;Library &#039; &#124;&#124; &amp;LIB2WORK &#124;&#124; &#039; failed +     
                               for DSPPGMREF command&#039;) TOUSR(U860970))
               ENDDO                                                  
            ENDDO                                                     
                                                                      
ENDIT:      ENDPGM                                                    

&lt;/pre&gt;


Once this table is defined, you can build this command/program/query combo for quick answers to your &quot;Where is this object used&quot; questions...

Here is the WHEREUSED command:
&lt;pre&gt;

CMD        PROMPT(&#039;Identify where object is used&#039;)     
PARM       KWD(OBJNAM) TYPE(*CHAR) LEN(10) MIN(1) +    
             CHOICE(&#039;Enter all/partial object name&#039;) + 
             PROMPT(&#039;Object Name&#039;)                     

&lt;/pre&gt;

Here is the WHEREUSED program:
&lt;pre&gt;

STARTHERE:  PGM        PARM(&amp;OBJIN)                                    
                                                                       
DECLARE:    DCL        VAR(&amp;OBJIN) TYPE(*CHAR) LEN(10)                 
            DCL        VAR(&amp;VAR) TYPE(*CHAR) LEN(13)                   
                                                                       
            CHGVAR     VAR(&amp;VAR) VALUE(&#039;&#039;&#039;&#039; &#124;&#124; &amp;OBJIN &#124;&lt; &#039;%&#039; &#124;&lt; &#039;&#039;&#039;&#039;)  
RUNQRY:     STRQMQRY   QMQRY(WHEREUSED) OUTPUT(*) SETVAR((OBJREF +     
                         &amp;VAR))                                        
                                                                       
ENDPGM:     ENDPGM                                                     

&lt;/pre&gt;

Here is the source for the *QMQRY object:
&lt;pre&gt;

SELECT DISTINCT                                        
-- Columns                                             
      A.WHFNAM, A.WHLIB,  A.WHPNAM, A.WHTEXT,          
      A.WHSNAM, A.WHFUSG, A.WHOTYP, A.WHSPKG           
-- Tables                                              
      FROM PGMREFS A                                   
-- Selected Records                                    
      WHERE WHFNAM LIKE &amp;OBJREF                        
-- Sort Columns                                        
      ORDER BY A.WHLIB, A.WHPNAM, A.WHFNAM, A.WHSNAM   

&lt;/pre&gt;

At our site, we no longer utilize this, because we purchase a product called X-Analysis from &lt;a href=&quot;http://www.databorough.com&quot;&gt;Databorough&lt;/a&gt;.  It provides all the whereused/whatused functionality for IBM i based code as well as providing those answers to non-IBM i based connection to IBM i based objects (e.g. JDBC/ODBC connections from java/.net/VB code sitting on AIX/Windows servers).]]></description>
		<content:encoded><![CDATA[<p>For a quick look, DSPPGMREF will work.  I&#8217;ve written this program/command combo that builds the program reference file for all the libraries you specifiy.  Put it on the schedule to run regularly, and you have a table that is always available to answer your queries:</p>
<p>Command:</p>
<pre>

CMD        PROMPT('Update Program References')              
PARM       KWD(REFLIB) TYPE(*NAME) LEN(10) PROMPT('Library +
             where Ref. DB Created')                        
PARM       KWD(LIBS) TYPE(*NAME) LEN(10) MIN(1) MAX(250) +  
             PROMPT('Library name')                         

</pre>
<p>The program behind the command:</p>
<pre>

            PGM        PARM(&amp;BCLIB &amp;LIBSTOREF)                  
                                                                
DECLARES:                                                       
            /* Lib where file exists     */                     
            DCL        VAR(&amp;BCLIB) TYPE(*CHAR) LEN(10)          
            /* Libs containing objects to reference(up to 30) */
            DCL        VAR(&amp;LIBSTOREF) TYPE(*CHAR) LEN(2502)    
                                                                
            /* Current list item number */                      
            DCL        VAR(&amp;CURNBR) TYPE(*DEC) LEN(5 0)         
            /* Current library being processed */               
            DCL        VAR(&amp;CURLSTITM) TYPE(*CHAR) LEN(100)     
            /* Library being worked */                          
            DCL        VAR(&amp;LIB2WORK) TYPE(*CHAR) LEN(10)       
                                                                
            /* Work variables for display */                    
            DCL        VAR(&amp;LISTCOUNT) TYPE(*DEC) LEN(5 0)      
            DCL        VAR(&amp;WORK22) TYPE(*CHAR) LEN(22)         
            /*Build the reference file new each time */                      
            CLRPFM     FILE(&amp;BCLIB/PGMREFS)                                  
                                                                             
            /* Display in job log the number of list items being processed */
            CHGVAR     VAR(&amp;LISTCOUNT) VALUE(%BIN(&amp;LIBSTOREF 1 2))           
            EDTVAR     CHROUT(&amp;WORK22) NUMINP(&amp;LISTCOUNT)                    
            SNDPGMMSG  MSG(&amp;WORK22 |&lt; ' Libraries in the list')              
                                                                             
            DOWHILE    COND(&amp;CURNBR *GE 0)                                   
            /* Extract list for processing */                                
               EXTLST     LIST(&amp;LIBSTOREF) ELMLEN(10) ELEMENT(&amp;CURLSTITM) +  
                            CURNBR(&amp;CURNBR)                                  
                                                                             
               IF         COND(&amp;CURNBR *GE 0) THEN(DO)                       
                                                                             
                  CHGVAR     VAR(&amp;LIB2WORK) VALUE(%SST(&amp;CURLSTITM 1 10))     
                                                                             
                  SNDPGMMSG  MSG('Processing... ' || &amp;LIB2WORK)              
                  DSPPGMREF  PGM(&amp;LIB2WORK/*ALL) OUTPUT(*OUTFILE) +          
                               OBJTYPE(*ALL) OUTFILE(&amp;BCLIB/PGMREFS) +       
                               OUTMBR(*FIRST *ADD)                           
                                                                             
ERRMSG:           MONMSG     MSGID(CPF3064 CPF3033 CPF3034) EXEC(SNDMSG +    
                               MSG('Library ' || &amp;LIB2WORK || ' failed +     
                               for DSPPGMREF command') TOUSR(U860970))
               ENDDO                                                  
            ENDDO                                                     
                                                                      
ENDIT:      ENDPGM                                                    

</pre>
<p>Once this table is defined, you can build this command/program/query combo for quick answers to your &#8220;Where is this object used&#8221; questions&#8230;</p>
<p>Here is the WHEREUSED command:</p>
<pre>

CMD        PROMPT('Identify where object is used')     
PARM       KWD(OBJNAM) TYPE(*CHAR) LEN(10) MIN(1) +    
             CHOICE('Enter all/partial object name') + 
             PROMPT('Object Name')                     

</pre>
<p>Here is the WHEREUSED program:</p>
<pre>

STARTHERE:  PGM        PARM(&amp;OBJIN)                                    
                                                                       
DECLARE:    DCL        VAR(&amp;OBJIN) TYPE(*CHAR) LEN(10)                 
            DCL        VAR(&amp;VAR) TYPE(*CHAR) LEN(13)                   
                                                                       
            CHGVAR     VAR(&amp;VAR) VALUE('''' || &amp;OBJIN |&lt; '%' |&lt; '''')  
RUNQRY:     STRQMQRY   QMQRY(WHEREUSED) OUTPUT(*) SETVAR((OBJREF +     
                         &amp;VAR))                                        
                                                                       
ENDPGM:     ENDPGM                                                     

</pre>
<p>Here is the source for the *QMQRY object:</p>
<pre>

SELECT DISTINCT                                        
-- Columns                                             
      A.WHFNAM, A.WHLIB,  A.WHPNAM, A.WHTEXT,          
      A.WHSNAM, A.WHFUSG, A.WHOTYP, A.WHSPKG           
-- Tables                                              
      FROM PGMREFS A                                   
-- Selected Records                                    
      WHERE WHFNAM LIKE &amp;OBJREF                        
-- Sort Columns                                        
      ORDER BY A.WHLIB, A.WHPNAM, A.WHFNAM, A.WHSNAM   

</pre>
<p>At our site, we no longer utilize this, because we purchase a product called X-Analysis from <a href="http://www.databorough.com">Databorough</a>.  It provides all the whereused/whatused functionality for IBM i based code as well as providing those answers to non-IBM i based connection to IBM i based objects (e.g. JDBC/ODBC connections from java/.net/VB code sitting on AIX/Windows servers).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/programs-using-a-pf/#comment-96981</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 23 Sep 2011 13:15:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-96981</guid>
		<description><![CDATA[The DspPgmRef command can create an outfile of all programs in a library and what files they use but it does not excent to SQL uses.

The DspDBR will give you a list of logicals over the pf.  Using any of these means using the physical.
Phil]]></description>
		<content:encoded><![CDATA[<p>The DspPgmRef command can create an outfile of all programs in a library and what files they use but it does not excent to SQL uses.</p>
<p>The DspDBR will give you a list of logicals over the pf.  Using any of these means using the physical.<br />
Phil</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.013 seconds using memcached
Object Caching 324/327 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 22:22:40 -->