 




<?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: Retrieving the name of a file from object links</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 20:47:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117456</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Thu, 21 Mar 2013 22:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117456</guid>
		<description><![CDATA[Re BigKat&#039;s FTP: Essentially all network functions can be routed right back to the originating server. It&#039;s a very useful testing technique to remember for the future. Testing can be done even when you only have a single server simply by using appropriate host names (or IP addresses or even APPN control point names).
&#160;
Re &quot;programmed solution&quot;: Yes, Scott Klement&#039;s method is indeed. To clarify, I was referring to FTP and supplying an alternative to that. Other members following the thread might not allow FTP to be active on their server.&#160;Your acceptance of Scott&#039;s work indicated that you were wanting direct programming rather than something of a workaround (i.e., FTP). So, I was showing the basics that was even more direct and that didn&#039;t require an optional OS component. I use Qshell regularly on my own systems just as you&#039;re using it.
&#160;
But because I also work on many other systems, I know that lots of members need alternatives. Qshell won&#039;t be available for some others, and PTF issues might cause trouble for some in production environments.
&#160;
Qshell interaction with QSYS.LIB features does get a little twisted from time to time. If direct access to /root via APIs is understood, or at least working examples are available, some members will get use out of it.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>Re BigKat&#8217;s FTP: Essentially all network functions can be routed right back to the originating server. It&#8217;s a very useful testing technique to remember for the future. Testing can be done even when you only have a single server simply by using appropriate host names (or IP addresses or even APPN control point names).<br />
&nbsp;<br />
Re &#8220;programmed solution&#8221;: Yes, Scott Klement&#8217;s method is indeed. To clarify, I was referring to FTP and supplying an alternative to that. Other members following the thread might not allow FTP to be active on their server.&nbsp;Your acceptance of Scott&#8217;s work indicated that you were wanting direct programming rather than something of a workaround (i.e., FTP). So, I was showing the basics that was even more direct and that didn&#8217;t require an optional OS component. I use Qshell regularly on my own systems just as you&#8217;re using it.<br />
&nbsp;<br />
But because I also work on many other systems, I know that lots of members need alternatives. Qshell won&#8217;t be available for some others, and PTF issues might cause trouble for some in production environments.<br />
&nbsp;<br />
Qshell interaction with QSYS.LIB features does get a little twisted from time to time. If direct access to /root via APIs is understood, or at least working examples are available, some members will get use out of it.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117447</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Thu, 21 Mar 2013 15:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117447</guid>
		<description><![CDATA[BigKat, agreed. My mistake. Company is sending us the file, i just have to retrieve it and don&#039;t know the name. But i found the code that completely helps.Tom, thanks. I think the resolution i posed with the clle code is an actual programmed solutions. I&#039;m using code within a source member to retrieve information. i can make it a dynamic process for other programs to use, but i didn&#039;t because this isn&#039;t a common issue.I appreciate the help from both though!]]></description>
		<content:encoded><![CDATA[<p>BigKat, agreed. My mistake. Company is sending us the file, i just have to retrieve it and don&#8217;t know the name. But i found the code that completely helps.Tom, thanks. I think the resolution i posed with the clle code is an actual programmed solutions. I&#8217;m using code within a source member to retrieve information. i can make it a dynamic process for other programs to use, but i didn&#8217;t because this isn&#8217;t a common issue.I appreciate the help from both though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BigKat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117446</link>
		<dc:creator>BigKat</dc:creator>
		<pubDate>Thu, 21 Mar 2013 15:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117446</guid>
		<description><![CDATA[oh, I thought the files were still on the other system when you had to determine the dynamic name.&#160; Although as Tom mentioned, you can FTP back to yourself and it shouldn&#039;t be restricted, as the data is already being FTP&#039;d to you.]]></description>
		<content:encoded><![CDATA[<p>oh, I thought the files were still on the other system when you had to determine the dynamic name.&nbsp; Although as Tom mentioned, you can FTP back to yourself and it shouldn&#8217;t be restricted, as the data is already being FTP&#8217;d to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117440</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Thu, 21 Mar 2013 13:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117440</guid>
		<description><![CDATA[If you prefer an actual programmed solution, Qshell isn&#039;t necessary. ILE CL can read directories directly:&lt;PRE&gt;pgm    ( +
         &amp;DirName     +
       )

   dcl   &amp;DirName     *char  128


   dcl   &amp;FName       *char  640

   dcl   &amp;x00         *char    1     value( x&#039;00&#039; )

   dcl   &amp;rc          *int
   dcl   &amp;subrc       *int

   dcl   &amp;Dir         *char  128
   dcl   &amp;Link        *char  640

   dcl   &amp;BUF         *char 4096
   dcl   &amp;mtime       *int           stg( *defined ) defvar( &amp;BUF    29 )
   dcl   &amp;oType       *char   10     stg( *defined ) defvar( &amp;BUF    49 )

   dcl   &amp;pCTime      *ptr
   dcl   &amp;CTime       *char   24     +
                         stg( *BASED )  +
                         basptr( &amp;pCTime )

   dcl   &amp;pDir        *ptr
   dcl   &amp;DirDS       *char    1     +
                         stg( *BASED )  +
                         basptr( &amp;pDir )

 /* Directory entry DS */
   dcl   &amp;pDirEnt     *ptr
   dcl   &amp;DirEnt      *char 1024     +
                         stg( *BASED )  +
                         basptr( &amp;pDirEnt )
   dcl   &amp;res1        *char   16     stg( *defined ) defvar( &amp;DirEnt  1 )
   dcl   &amp;sgenid      *uint          stg( *defined ) defvar( &amp;DirEnt 17 )
   dcl   &amp;sfileno     *int           stg( *defined ) defvar( &amp;DirEnt 21 )
   dcl   &amp;sreclen     *uint          stg( *defined ) defvar( &amp;DirEnt 25 )
   dcl   &amp;res2        *int           stg( *defined ) defvar( &amp;DirEnt 29 )
   dcl   &amp;res3        *char    8     stg( *defined ) defvar( &amp;DirEnt 33 )
   dcl   &amp;snlsinf     *char   12     stg( *defined ) defvar( &amp;DirEnt 41 )
   dcl   &amp;snamlen     *uint          stg( *defined ) defvar( &amp;DirEnt 53 )
   dcl   &amp;sfname      *char  640     stg( *defined ) defvar( &amp;DirEnt 57 )

   dcl   &amp;nullptr     *ptr


   monmsg    ( cpf0000 mch0000 cpf9999 ) exec( goto StdErr )


   chgvar            &amp;Dir         ( &amp;DirName *tcat &amp;x00 )

   callprc     &#039;opendir&#039;          ( &amp;Dir ) rtnval( &amp;pDir )
   if ( &amp;pDir *eq &amp;nullptr )  +
      goto  Close_Dir

   dountil  ( &amp;pDirEnt *eq &amp;nullptr )

      callprc     &#039;readdir&#039;       ( &amp;DirDS ) rtnval( &amp;pDirEnt )
      if ( &amp;pDirEnt *ne &amp;nullptr )  +
         callsubr    OutEntry     rtnval( &amp;subrc )

   enddo

   goto  Close_Dir

StdErr:

   dmpclpgm
   monmsg (cpf0000 cpf9999 mch0000)

Close_Dir:

   callprc     &#039;closedir&#039;         ( &amp;DirDS ) rtnval( &amp;rc )
   monmsg (cpf0000 cpf9999 cee0000 mch0000)

   return

subr     OutEntry

   if ( &amp;snamlen *gt 0 )  do
      chgvar        &amp;FName    %sst( &amp;sfname 1 &amp;snamlen )
      chgvar        &amp;Link         ( +
                                    &amp;DirName *tcat &#039;/&#039; *cat +
                                    &amp;FName   *tcat +
                                    &amp;x00  +
                                  )
      callprc     &#039;stat&#039;          ( &amp;Link &amp;BUF ) rtnval( &amp;rc )

      if ( &amp;rc *eq 0 )  do
         callprc  &#039;ctime&#039;         ( &amp;mtime ) rtnval( &amp;pCTime )
         sndpgmmsg   msgid( CPF9898 ) msgf( QCPFMSG ) +
                       msgdta( +
                               &#039;Object Found&#039;   *bcat +
                               &amp;CTime           *bcat +
                               &amp;FName           *bcat +
                               &amp;oType                 +
                             ) +
                       msgtype( *INFO )
      enddo
      else  +
         rtnsubr rtnval( -1 )
   enddo

   endsubr

endpgm&lt;/PRE&gt;
The program accepts a 128-char directory and lists its contents via messages. Note that the directory name parm value must be padded with blanks if it&#039;s shorter than 128 characters.
&#160;
Compile as a *MODULE. Then use CRTPGM to create the program from the *MODULE and specify BNDDIR(QC2LE) to pull in the APIs.
&#160;
Modify it to cut out the stuff for sending the messages. It&#039;s just an example program, so it can simply return a file name as an output parm. Use this version just to see how opendir(), readdir() and closedir() work.
&#160;
Note that all directories include the [.] and [..] entries. Simple IF-tests can skip those.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>If you prefer an actual programmed solution, Qshell isn&#8217;t necessary. ILE CL can read directories directly:
<pre>pgm    ( +
         &amp;DirName     +
       )

   dcl   &amp;DirName     *char  128


   dcl   &amp;FName       *char  640

   dcl   &amp;x00         *char    1     value( x&#8217;00&#8242; )

   dcl   &amp;rc          *int
   dcl   &amp;subrc       *int

   dcl   &amp;Dir         *char  128
   dcl   &amp;Link        *char  640

   dcl   &amp;BUF         *char 4096
   dcl   &amp;mtime       *int           stg( *defined ) defvar( &amp;BUF    29 )
   dcl   &amp;oType       *char   10     stg( *defined ) defvar( &amp;BUF    49 )

   dcl   &amp;pCTime      *ptr
   dcl   &amp;CTime       *char   24     +
                         stg( *BASED )  +
                         basptr( &amp;pCTime )

   dcl   &amp;pDir        *ptr
   dcl   &amp;DirDS       *char    1     +
                         stg( *BASED )  +
                         basptr( &amp;pDir )

 /* Directory entry DS */
   dcl   &amp;pDirEnt     *ptr
   dcl   &amp;DirEnt      *char 1024     +
                         stg( *BASED )  +
                         basptr( &amp;pDirEnt )
   dcl   &amp;res1        *char   16     stg( *defined ) defvar( &amp;DirEnt  1 )
   dcl   &amp;sgenid      *uint          stg( *defined ) defvar( &amp;DirEnt 17 )
   dcl   &amp;sfileno     *int           stg( *defined ) defvar( &amp;DirEnt 21 )
   dcl   &amp;sreclen     *uint          stg( *defined ) defvar( &amp;DirEnt 25 )
   dcl   &amp;res2        *int           stg( *defined ) defvar( &amp;DirEnt 29 )
   dcl   &amp;res3        *char    8     stg( *defined ) defvar( &amp;DirEnt 33 )
   dcl   &amp;snlsinf     *char   12     stg( *defined ) defvar( &amp;DirEnt 41 )
   dcl   &amp;snamlen     *uint          stg( *defined ) defvar( &amp;DirEnt 53 )
   dcl   &amp;sfname      *char  640     stg( *defined ) defvar( &amp;DirEnt 57 )

   dcl   &amp;nullptr     *ptr


   monmsg    ( cpf0000 mch0000 cpf9999 ) exec( goto StdErr )


   chgvar            &amp;Dir         ( &amp;DirName *tcat &amp;x00 )

   callprc     &#8216;opendir&#8217;          ( &amp;Dir ) rtnval( &amp;pDir )
   if ( &amp;pDir *eq &amp;nullptr )  +
      goto  Close_Dir

   dountil  ( &amp;pDirEnt *eq &amp;nullptr )

      callprc     &#8216;readdir&#8217;       ( &amp;DirDS ) rtnval( &amp;pDirEnt )
      if ( &amp;pDirEnt *ne &amp;nullptr )  +
         callsubr    OutEntry     rtnval( &amp;subrc )

   enddo

   goto  Close_Dir

StdErr:

   dmpclpgm
   monmsg (cpf0000 cpf9999 mch0000)

Close_Dir:

   callprc     &#8216;closedir&#8217;         ( &amp;DirDS ) rtnval( &amp;rc )
   monmsg (cpf0000 cpf9999 cee0000 mch0000)

   return

subr     OutEntry

   if ( &amp;snamlen *gt 0 )  do
      chgvar        &amp;FName    %sst( &amp;sfname 1 &amp;snamlen )
      chgvar        &amp;Link         ( +
                                    &amp;DirName *tcat &#8216;/&#8217; *cat +
                                    &amp;FName   *tcat +
                                    &amp;x00  +
                                  )
      callprc     &#8216;stat&#8217;          ( &amp;Link &amp;BUF ) rtnval( &amp;rc )

      if ( &amp;rc *eq 0 )  do
         callprc  &#8216;ctime&#8217;         ( &amp;mtime ) rtnval( &amp;pCTime )
         sndpgmmsg   msgid( CPF9898 ) msgf( QCPFMSG ) +
                       msgdta( +
                               &#8216;Object Found&#8217;   *bcat +
                               &amp;CTime           *bcat +
                               &amp;FName           *bcat +
                               &amp;oType                 +
                             ) +
                       msgtype( *INFO )
      enddo
      else  +
         rtnsubr rtnval( -1 )
   enddo

   endsubr

endpgm</pre>
<p>The program accepts a 128-char directory and lists its contents via messages. Note that the directory name parm value must be padded with blanks if it&#8217;s shorter than 128 characters.<br />
&nbsp;<br />
Compile as a *MODULE. Then use CRTPGM to create the program from the *MODULE and specify BNDDIR(QC2LE) to pull in the APIs.<br />
&nbsp;<br />
Modify it to cut out the stuff for sending the messages. It&#8217;s just an example program, so it can simply return a file name as an output parm. Use this version just to see how opendir(), readdir() and closedir() work.<br />
&nbsp;<br />
Note that all directories include the [.] and [..] entries. Simple IF-tests can skip those.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117434</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Thu, 21 Mar 2013 12:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117434</guid>
		<description><![CDATA[Interesting. I guess it just seemed illogical to me to have to ftp the system you&#039;re already on. I dunno haha. But i did find a solution at the following url:&lt;a href=&quot;http://www.iprodeveloper.com/forums/aft/79181&quot; rel=&quot;nofollow&quot;&gt;http://www.iprodeveloper.com/forums/aft/79181&lt;/a&gt;The solution was done by a Developer named Scott Klement. I modified it for what I needed.Basically the CLLE handles the QSHELL command to retrieve the full path into the record of the file declared. You can see i&#039;m substringing the filename because there could be 3&#160;variations of the name.Anyway, here&#039;s the code:&#160; &#160; &#160; &#160; &#160; &#160; &#160;PGM &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;DCL &#160; &#160; &#160; &#160;VAR(&amp;FILENAME) TYPE(*CHAR) LEN(30) &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;DCL &#160; &#160; &#160; &#160;VAR(&amp;FILE_EXT) TYPE(*CHAR) LEN(04) VALUE(&#039;.csv&#039;)&#160; &#160; &#160; &#160; &#160; &#160; &#160;DCLF &#160; &#160; &#160; FILE(EWITHAM/IFSDCLI00) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;OVRDBF &#160; &#160; FILE(STDOUT) TOFILE(DIROUTPUT) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;QSH &#160; &#160; &#160; &#160;CMD(&#039;ls /depotsystems/chassis/dcli*&#039;) &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;#READ: &#160; &#160; &#160;RCVF &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;MONMSG &#160; &#160; MSGID(CPF0864) EXEC(GOTO CMDLBL(#EOF)) &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;SELECT &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;WHEN &#160; &#160; &#160; COND(%SST(&amp;FULLPATH 46 4) *EQ &amp;FILE_EXT) &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;CHGVAR &#160; &#160; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 27)) &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;WHEN &#160; &#160; &#160; COND(%SST(&amp;FULLPATH 47 4) *EQ &amp;FILE_EXT) &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;CHGVAR &#160; &#160; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 28)) &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;WHEN &#160; &#160; &#160; COND(%SST(&amp;FULLPATH 48 4) *EQ &amp;FILE_EXT) &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;CHGVAR &#160; &#160; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 29)) &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;ENDSELECT &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;GOTO &#160; &#160; &#160; CMDLBL(START) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;#EOF: &#160; &#160; &#160; ENDPGM]]></description>
		<content:encoded><![CDATA[<p>Interesting. I guess it just seemed illogical to me to have to ftp the system you&#8217;re already on. I dunno haha. But i did find a solution at the following url:<a href="http://www.iprodeveloper.com/forums/aft/79181" rel="nofollow">http://www.iprodeveloper.com/forums/aft/79181</a>The solution was done by a Developer named Scott Klement. I modified it for what I needed.Basically the CLLE handles the QSHELL command to retrieve the full path into the record of the file declared. You can see i&#8217;m substringing the filename because there could be 3&nbsp;variations of the name.Anyway, here&#8217;s the code:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PGM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DCL &nbsp; &nbsp; &nbsp; &nbsp;VAR(&amp;FILENAME) TYPE(*CHAR) LEN(30) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DCL &nbsp; &nbsp; &nbsp; &nbsp;VAR(&amp;FILE_EXT) TYPE(*CHAR) LEN(04) VALUE(&#8216;.csv&#8217;)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DCLF &nbsp; &nbsp; &nbsp; FILE(EWITHAM/IFSDCLI00) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OVRDBF &nbsp; &nbsp; FILE(STDOUT) TOFILE(DIROUTPUT) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;QSH &nbsp; &nbsp; &nbsp; &nbsp;CMD(&#8216;ls /depotsystems/chassis/dcli*&#8217;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;#READ: &nbsp; &nbsp; &nbsp;RCVF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MONMSG &nbsp; &nbsp; MSGID(CPF0864) EXEC(GOTO CMDLBL(#EOF)) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHEN &nbsp; &nbsp; &nbsp; COND(%SST(&amp;FULLPATH 46 4) *EQ &amp;FILE_EXT) &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHGVAR &nbsp; &nbsp; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 27)) &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHEN &nbsp; &nbsp; &nbsp; COND(%SST(&amp;FULLPATH 47 4) *EQ &amp;FILE_EXT) &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHGVAR &nbsp; &nbsp; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 28)) &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHEN &nbsp; &nbsp; &nbsp; COND(%SST(&amp;FULLPATH 48 4) *EQ &amp;FILE_EXT) &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHGVAR &nbsp; &nbsp; VAR(&amp;FILENAME) VALUE(%SST(&amp;FULLPATH 23 29)) &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ENDSELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GOTO &nbsp; &nbsp; &nbsp; CMDLBL(START) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;#EOF: &nbsp; &nbsp; &nbsp; ENDPGM</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117416</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Thu, 21 Mar 2013 02:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117416</guid>
		<description><![CDATA[&lt;EM&gt;...so i can’t very well FTP to the same system.&lt;/EM&gt;
&#160;
Why not? Is it restricted?
&#160;
FTP to/from same system might be the easiest way to do it. It&#039;s certainly possible to read directory entries, but it&#039;s a little more complicated.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p><em>&#8230;so i can’t very well FTP to the same system.</em><br />
&nbsp;<br />
Why not? Is it restricted?<br />
&nbsp;<br />
FTP to/from same system might be the easiest way to do it. It&#8217;s certainly possible to read directory entries, but it&#8217;s a little more complicated.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117409</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Wed, 20 Mar 2013 15:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/retrieving-the-name-of-a-file-from-object-links/#comment-117409</guid>
		<description><![CDATA[I&#039;m not entirely sure this is something that would work. The system I&#039;m on is where the file is, so i can&#039;t very well FTP to the same system.This is in the IFS and I get to the file using the WRKLNK &#039;/&#039; command. One of the directories holds a .CSV file and i&#039;m just trying to retrieve the name of the .CSV file.&#160;The only option i can think of is to do a DSPLNK and mark the output as *PRINT, then copy the spooled file to a physical flat file and read that. Since there&#039;s only going to be 1 file in there at a time per day, this might be one of the few workarounds without having to use API&#039;s, which, i&#039;m not entirely opposed to. It just seems that there should be an easier way to deal with the IFS.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not entirely sure this is something that would work. The system I&#8217;m on is where the file is, so i can&#8217;t very well FTP to the same system.This is in the IFS and I get to the file using the WRKLNK &#8216;/&#8217; command. One of the directories holds a .CSV file and i&#8217;m just trying to retrieve the name of the .CSV file.&nbsp;The only option i can think of is to do a DSPLNK and mark the output as *PRINT, then copy the spooled file to a physical flat file and read that. Since there&#8217;s only going to be 1 file in there at a time per day, this might be one of the few workarounds without having to use API&#8217;s, which, i&#8217;m not entirely opposed to. It just seems that there should be an easier way to deal with the IFS.</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 3/10 queries in 0.027 seconds using memcached
Object Caching 351/357 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 20:51:13 -->