 




<?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: Retrieve RPGLE source date</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/retrieve-rpgle-source-date/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieve-rpgle-source-date/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 12:30:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Featured Member: Vatchy - ITKE Community Blog</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieve-rpgle-source-date/#comment-85830</link>
		<dc:creator>Featured Member: Vatchy - ITKE Community Blog</dc:creator>
		<pubDate>Tue, 28 Dec 2010 06:30:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-85830</guid>
		<description><![CDATA[[...] Retrieve RPGLE source date [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Retrieve RPGLE source date [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieve-rpgle-source-date/#comment-85236</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Sun, 12 Dec 2010 06:43:01 +0000</pubDate>
		<guid isPermaLink="false">#comment-85236</guid>
		<description><![CDATA[Here&#039;s a sample program that should demonstrate basic retrieval of module info. It&#039;s an ILE CL program that accepts a library name. It lists the modules of all ILE programs into a user space. Then it loops through the list printing a line per module showing program name, module, source file and member and source change date/time:&lt;pre&gt;
pgm    ( +
         &amp;pLib       +
       )

   dcl   &amp;pLib       *char    10


   dcl   &amp;qObj       *char    20

   dcl   &amp;qUsrSpc    *char    20     value( &#039;LSTPGMMOD QTEMP&#039; )

   dcl   &amp;Pgm        *char    10     value( &#039; &#039; )
   dcl   &amp;PgmLib     *char    10     value( &#039; &#039; )
   dcl   &amp;Mod        *char    10     value( &#039; &#039; )
   dcl   &amp;ModLib     *char    10     value( &#039; &#039; )
   dcl   &amp;SrcF       *char    10     value( &#039; &#039; )
   dcl   &amp;SrcFLib    *char    10     value( &#039; &#039; )
   dcl   &amp;SrcMbr     *char    10     value( &#039; &#039; )
   dcl   &amp;ModCrt     *char    13     value( &#039; &#039; )
   dcl   &amp;SrcChg     *char    13     value( &#039; &#039; )

/* General fields for retrieve *USRSPC header...                    */
   dcl   &amp;offslst    *int
   dcl   &amp;nbrlste    *int
   dcl   &amp;sizlste    *int

   dcl   &amp;NbrLE      *int

   dcl   &amp;us_hdr     *char   150
   dcl   &amp;ModEnt     *char   512

   dcl   &amp;rc         *int            value( 0 )
   dcl   &amp;nl         *char     1     value( x&#039;15&#039; )
   dcl   &amp;ff         *char     1     value( x&#039;0C&#039; )
   dcl   &amp;nul        *char     1     value( x&#039;00&#039; )

   dcl   &amp;PagHdr     *char   134
   dcl   &amp;MsgTxt     *char   134
   dcl   &amp;lines      *int            value( 3 )


/* Create a *USRSPC...                                                       */

   call  QUSCRTUS         ( +
                            &amp;qusrspc                +
                            &#039;PGMMOD    &#039;            +
                            x&#039;00004000&#039;             +
                            X&#039;00&#039;                   +
                            &#039;*ALL      &#039;            +
                  &#039;List *PGM module info                             &#039; +
                            &#039;*YES      &#039;            +
                            x&#039;0000000000000000&#039;     +
                          )


/* List *ALL program&#039;s modules into *USRSPC...                               */

   chgvar          &amp;qObj            ( &#039;*ALL      &#039; *cat &amp;pLib )

   call  QBNLPGMI         ( +
                            &amp;qusrspc                +
                            &#039;PGML0100&#039;              +
                            &amp;qObj                   +
                            x&#039;0000000000000000&#039;     +
                          )

/* Retrieve *USRSPC header for offset, count and size of entries...          */

   call  QUSRTVUS         ( +
                            &amp;qusrspc                +
                            x&#039;00000001&#039;             +
                            x&#039;00000096&#039;             +
                            &amp;us_hdr                 +
                          )

/*                                                           */
/* Get the offset to the list within the space, the number   */
/*   of list entries and size of each entry from the header. */
/*                                                           */
   chgvar          &amp;offslst     %bin( &amp;us_hdr    125 4 )
   chgvar          &amp;nbrlste     %bin( &amp;us_hdr    133 4 )
   chgvar          &amp;sizlste     %bin( &amp;us_hdr    137 4 )

/* If no entries, then get out of here...                    */

   if  ( &amp;nbrlste *eq 0 )     do
      sndpgmmsg  msgid( CPF9897 ) msgf( QCPFMSG ) +
                   msgdta( &#039;No modules found.&#039; )
      goto   End_Mod
   enddo


/* Set the offset to the list within the space...            */

   chgvar          &amp;offslst         ( &amp;offslst  + 1 )
   chgvar          &amp;NBRLE             &amp;nbrlste


/* Set up report; print first heading...                     */

   ovrprtf  stdout  qsysprt +
              dfrwrt( *NO ) +
              splfname( PGMMODLST ) +
              ovrscope( *ACTGRPDFN ) +
              opnscope( *ACTGRPDFN )

   chgvar          &amp;PagHdr          ( +
                                     &#039;Program    Library    Module     +
                                      Mod Lib    Src File   Src Lib    +
                                      Member     Chg Date&#039;       *cat  +
                                      &amp;NL          *cat  +
                                     &#039; &#039;           *cat  +
                                      &amp;NL          *cat  +
                                      &amp;nul               +
                                    )
   callprc    &#039;printf&#039;  ( +
                          &amp;PagHdr            +
                        ) +
                  rtnval( &amp;rc )

/* Loop through the list, printing the info...               */

   dountil (&amp;NbrLE *lt 1 )

      call  QUSRTVUS      ( +
                            &amp;qusrspc                +
                            &amp;offslst                +
                            &amp;sizlste                +
                            &amp;ModENT                 +
                          )


/* Get the module, program and library from the list...                      */

      chgvar       &amp;Pgm         %sst( &amp;ModENT   1 10 )
      chgvar       &amp;PgmLib      %sst( &amp;ModENT  11 10 )
      chgvar       &amp;Mod         %sst( &amp;ModENT  21 10 )
      chgvar       &amp;ModLib      %sst( &amp;ModENT  31 10 )
      chgvar       &amp;SrcF        %sst( &amp;ModENT  41 10 )
      chgvar       &amp;SrcFLib     %sst( &amp;ModENT  51 10 )
      chgvar       &amp;SrcMbr      %sst( &amp;ModENT  61 10 )
      chgvar       &amp;ModCrt      %sst( &amp;ModENT  81 13 )
      chgvar       &amp;SrcChg      %sst( &amp;ModENT  94 13 )

      sndpgmmsg  msgid( CPF9897 ) msgf( QCPFMSG ) +
                   msgdta( +
                           &#039;Found&#039; *bcat &amp;ModLib *tcat &#039;/&#039; *cat +
                           &amp;Mod +
                         ) +
                   topgmq( *EXT ) msgtype( *STATUS )

      chgvar       &amp;MsgTxt          ( +
                                      &amp;Pgm         *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;PgmLib      *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;Mod         *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;ModLib      *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;SrcF        *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;SrcFLib     *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;SrcMbr      *cat  +
                                      &#039; &#039;          *cat  +
                                      &amp;SrcChg      *cat  +
                                      &amp;NL          *cat  +
                                      &amp;nul               +
                                    )
      callprc &#039;printf&#039;  ( +
                          &amp;MsgTxt            +
                        ) +
                  rtnval( &amp;rc )

      chgvar       &amp;lines           ( &amp;lines + 1 )
      if ( &amp;lines *gt 55 )  do
         callprc &#039;printf&#039;  ( &amp;ff ) rtnval( &amp;rc )
         callprc &#039;printf&#039;  ( +
                             &amp;PagHdr            +
                           ) +
                     rtnval( &amp;rc )
         chgvar    &amp;lines           ( 3 )
      enddo

/* Decrement our loop counter and loop back if more...                       */

      chgvar       &amp;offslst         ( &amp;offslst + &amp;sizlste )
      chgvar       &amp;NbrLE           ( &amp;NbrLE - 1 )

   enddo


End_Mod:

/* Clear override and delete the *USRSPC...                                  */
   dltovr      STDOUT  lvl( *ACTGRPDFN )
   call  QUSDLTUS         ( +
                            &amp;qusrspc                +
                            x&#039;0000000000000000&#039;     +
                          )

   return

endpgm&lt;/pre&gt;
Any OPM program will be ignored. Modules are listed whether the module was compiled and bound with others or the program was created straight from a single module.

Note that the code must be compiled as a module. The program is then created with CRTPGM with BNDDIR(QC2LE) and ACTGRP(*NEW). That brings the printf() API in and it closes the printer file when the *NEW activation group ends.

Tom]]></description>
		<content:encoded><![CDATA[<p>Here&#8217;s a sample program that should demonstrate basic retrieval of module info. It&#8217;s an ILE CL program that accepts a library name. It lists the modules of all ILE programs into a user space. Then it loops through the list printing a line per module showing program name, module, source file and member and source change date/time:
<pre>
pgm    ( +
         &amp;pLib       +
       )

   dcl   &amp;pLib       *char    10


   dcl   &amp;qObj       *char    20

   dcl   &amp;qUsrSpc    *char    20     value( 'LSTPGMMOD QTEMP' )

   dcl   &amp;Pgm        *char    10     value( ' ' )
   dcl   &amp;PgmLib     *char    10     value( ' ' )
   dcl   &amp;Mod        *char    10     value( ' ' )
   dcl   &amp;ModLib     *char    10     value( ' ' )
   dcl   &amp;SrcF       *char    10     value( ' ' )
   dcl   &amp;SrcFLib    *char    10     value( ' ' )
   dcl   &amp;SrcMbr     *char    10     value( ' ' )
   dcl   &amp;ModCrt     *char    13     value( ' ' )
   dcl   &amp;SrcChg     *char    13     value( ' ' )

/* General fields for retrieve *USRSPC header...                    */
   dcl   &amp;offslst    *int
   dcl   &amp;nbrlste    *int
   dcl   &amp;sizlste    *int

   dcl   &amp;NbrLE      *int

   dcl   &amp;us_hdr     *char   150
   dcl   &amp;ModEnt     *char   512

   dcl   &amp;rc         *int            value( 0 )
   dcl   &amp;nl         *char     1     value( x'15' )
   dcl   &amp;ff         *char     1     value( x'0C' )
   dcl   &amp;nul        *char     1     value( x'00' )

   dcl   &amp;PagHdr     *char   134
   dcl   &amp;MsgTxt     *char   134
   dcl   &amp;lines      *int            value( 3 )


/* Create a *USRSPC...                                                       */

   call  QUSCRTUS         ( +
                            &amp;qusrspc                +
                            'PGMMOD    '            +
                            x'00004000'             +
                            X'00'                   +
                            '*ALL      '            +
                  'List *PGM module info                             ' +
                            '*YES      '            +
                            x'0000000000000000'     +
                          )


/* List *ALL program's modules into *USRSPC...                               */

   chgvar          &amp;qObj            ( '*ALL      ' *cat &amp;pLib )

   call  QBNLPGMI         ( +
                            &amp;qusrspc                +
                            'PGML0100'              +
                            &amp;qObj                   +
                            x'0000000000000000'     +
                          )

/* Retrieve *USRSPC header for offset, count and size of entries...          */

   call  QUSRTVUS         ( +
                            &amp;qusrspc                +
                            x'00000001'             +
                            x'00000096'             +
                            &amp;us_hdr                 +
                          )

/*                                                           */
/* Get the offset to the list within the space, the number   */
/*   of list entries and size of each entry from the header. */
/*                                                           */
   chgvar          &amp;offslst     %bin( &amp;us_hdr    125 4 )
   chgvar          &amp;nbrlste     %bin( &amp;us_hdr    133 4 )
   chgvar          &amp;sizlste     %bin( &amp;us_hdr    137 4 )

/* If no entries, then get out of here...                    */

   if  ( &amp;nbrlste *eq 0 )     do
      sndpgmmsg  msgid( CPF9897 ) msgf( QCPFMSG ) +
                   msgdta( 'No modules found.' )
      goto   End_Mod
   enddo


/* Set the offset to the list within the space...            */

   chgvar          &amp;offslst         ( &amp;offslst  + 1 )
   chgvar          &amp;NBRLE             &amp;nbrlste


/* Set up report; print first heading...                     */

   ovrprtf  stdout  qsysprt +
              dfrwrt( *NO ) +
              splfname( PGMMODLST ) +
              ovrscope( *ACTGRPDFN ) +
              opnscope( *ACTGRPDFN )

   chgvar          &amp;PagHdr          ( +
                                     'Program    Library    Module     +
                                      Mod Lib    Src File   Src Lib    +
                                      Member     Chg Date'       *cat  +
                                      &amp;NL          *cat  +
                                     ' '           *cat  +
                                      &amp;NL          *cat  +
                                      &amp;nul               +
                                    )
   callprc    'printf'  ( +
                          &amp;PagHdr            +
                        ) +
                  rtnval( &amp;rc )

/* Loop through the list, printing the info...               */

   dountil (&amp;NbrLE *lt 1 )

      call  QUSRTVUS      ( +
                            &amp;qusrspc                +
                            &amp;offslst                +
                            &amp;sizlste                +
                            &amp;ModENT                 +
                          )


/* Get the module, program and library from the list...                      */

      chgvar       &amp;Pgm         %sst( &amp;ModENT   1 10 )
      chgvar       &amp;PgmLib      %sst( &amp;ModENT  11 10 )
      chgvar       &amp;Mod         %sst( &amp;ModENT  21 10 )
      chgvar       &amp;ModLib      %sst( &amp;ModENT  31 10 )
      chgvar       &amp;SrcF        %sst( &amp;ModENT  41 10 )
      chgvar       &amp;SrcFLib     %sst( &amp;ModENT  51 10 )
      chgvar       &amp;SrcMbr      %sst( &amp;ModENT  61 10 )
      chgvar       &amp;ModCrt      %sst( &amp;ModENT  81 13 )
      chgvar       &amp;SrcChg      %sst( &amp;ModENT  94 13 )

      sndpgmmsg  msgid( CPF9897 ) msgf( QCPFMSG ) +
                   msgdta( +
                           'Found' *bcat &amp;ModLib *tcat '/' *cat +
                           &amp;Mod +
                         ) +
                   topgmq( *EXT ) msgtype( *STATUS )

      chgvar       &amp;MsgTxt          ( +
                                      &amp;Pgm         *cat  +
                                      ' '          *cat  +
                                      &amp;PgmLib      *cat  +
                                      ' '          *cat  +
                                      &amp;Mod         *cat  +
                                      ' '          *cat  +
                                      &amp;ModLib      *cat  +
                                      ' '          *cat  +
                                      &amp;SrcF        *cat  +
                                      ' '          *cat  +
                                      &amp;SrcFLib     *cat  +
                                      ' '          *cat  +
                                      &amp;SrcMbr      *cat  +
                                      ' '          *cat  +
                                      &amp;SrcChg      *cat  +
                                      &amp;NL          *cat  +
                                      &amp;nul               +
                                    )
      callprc 'printf'  ( +
                          &amp;MsgTxt            +
                        ) +
                  rtnval( &amp;rc )

      chgvar       &amp;lines           ( &amp;lines + 1 )
      if ( &amp;lines *gt 55 )  do
         callprc 'printf'  ( &amp;ff ) rtnval( &amp;rc )
         callprc 'printf'  ( +
                             &amp;PagHdr            +
                           ) +
                     rtnval( &amp;rc )
         chgvar    &amp;lines           ( 3 )
      enddo

/* Decrement our loop counter and loop back if more...                       */

      chgvar       &amp;offslst         ( &amp;offslst + &amp;sizlste )
      chgvar       &amp;NbrLE           ( &amp;NbrLE - 1 )

   enddo


End_Mod:

/* Clear override and delete the *USRSPC...                                  */
   dltovr      STDOUT  lvl( *ACTGRPDFN )
   call  QUSDLTUS         ( +
                            &amp;qusrspc                +
                            x'0000000000000000'     +
                          )

   return

endpgm</pre>
<p>Any OPM program will be ignored. Modules are listed whether the module was compiled and bound with others or the program was created straight from a single module.</p>
<p>Note that the code must be compiled as a module. The program is then created with CRTPGM with BNDDIR(QC2LE) and ACTGRP(*NEW). That brings the printf() API in and it closes the printer file when the *NEW activation group ends.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: astradyne</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieve-rpgle-source-date/#comment-40882</link>
		<dc:creator>astradyne</dc:creator>
		<pubDate>Sun, 17 Sep 2006 03:26:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-40882</guid>
		<description><![CDATA[There is no source date for an ILE program as there is no source.  An ILE program is comprised of a number of modules which are bound together to make the program and the modules can be of different languages.

To retrieve the source date you will have to pick up the attributes of the particular module.]]></description>
		<content:encoded><![CDATA[<p>There is no source date for an ILE program as there is no source.  An ILE program is comprised of a number of modules which are bound together to make the program and the modules can be of different languages.</p>
<p>To retrieve the source date you will have to pick up the attributes of the particular module.</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.018 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 13:30:11 -->