<?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: checking for a folder in IFS</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 04:33:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: loraestradanapier</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/#comment-109622</link>
		<dc:creator>loraestradanapier</dc:creator>
		<pubDate>Sat, 28 Jul 2012 01:02:07 +0000</pubDate>
		<guid isPermaLink="false">#comment-109622</guid>
		<description><![CDATA[&lt;p&gt;I know this is two years after the original post, but for anyone who is looking for this answer and wants to know how to check for a FOLDER or DIRECTORY and not a document, this simple logic works.&#160; I won&#039;t say I&#039;m proud of it..... It is more &quot;sleight of hand than anything&quot;.&lt;/p&gt;&lt;p&gt;Pass this program a path name, such as &#039;/System i Users/LNapier&#039;.&#160; The ChkOut command expects the&#160;OBJ parm&#160;to be a document, not just a directory.&#160; So, if the path is a directory, ChkOut will issue CPFA0DA.&lt;/p&gt;&lt;pre&gt;Pgm (&amp;In$Path &amp;Out$IsDir)                                   
             DCL        VAR(&amp;In$Path) TYPE(*CHAR) LEN(512)  
             DCL        VAR(&amp;Out$IsDir) TYPE(*LGL)          
                                                            
     ChgVar &amp;Out$IsDir &#039;0&#039;                                  
     CHKOUT     OBJ(&amp;IN$PATH)                               
     MONMSG     MSGID(CPFA0DA) EXEC(ChgVar &amp;Out$IsDir &#039;1&#039;)  
     MONMSG     MSGID(CPFA09C CPFA09D CPFA09E CPFA0A1 +     
                  CPFA0A3 CPFA0A7 CPFA0A9 CPFA0AA CPFA0AB + 
                  CPFA0AD CPFA0B2 CPFA0BF CPFA1C5)          
                                                            
EndPgm                                                      &lt;/pre&gt;&lt;p&gt;&#160;&lt;/p&gt;]]></description>
		<content:encoded><![CDATA[<p>I know this is two years after the original post, but for anyone who is looking for this answer and wants to know how to check for a FOLDER or DIRECTORY and not a document, this simple logic works.&nbsp; I won&#8217;t say I&#8217;m proud of it&#8230;.. It is more &#8220;sleight of hand than anything&#8221;.</p>
<p>Pass this program a path name, such as &#8216;/System i Users/LNapier&#8217;.&nbsp; The ChkOut command expects the&nbsp;OBJ parm&nbsp;to be a document, not just a directory.&nbsp; So, if the path is a directory, ChkOut will issue CPFA0DA.</p>
<pre>Pgm (&amp;In$Path &amp;Out$IsDir)                                   
             DCL        VAR(&amp;In$Path) TYPE(*CHAR) LEN(512)  
             DCL        VAR(&amp;Out$IsDir) TYPE(*LGL)          
                                                            
     ChgVar &amp;Out$IsDir '0'                                  
     CHKOUT     OBJ(&amp;IN$PATH)                               
     MONMSG     MSGID(CPFA0DA) EXEC(ChgVar &amp;Out$IsDir '1')  
     MONMSG     MSGID(CPFA09C CPFA09D CPFA09E CPFA0A1 +     
                  CPFA0A3 CPFA0A7 CPFA0A9 CPFA0AA CPFA0AB + 
                  CPFA0AD CPFA0B2 CPFA0BF CPFA1C5)          
                                                            
EndPgm                                                      </pre>
<p>&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: danthedane</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/#comment-76253</link>
		<dc:creator>danthedane</dc:creator>
		<pubDate>Tue, 20 Apr 2010 21:08:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-76253</guid>
		<description><![CDATA[Often this requirement is followed by the need to create the folder searched for. From my archives I found this cod&lt;pre&gt;PGM                                                     
DCL        VAR(&amp;ARKIV) TYPE(*CHAR) LEN(132)             
DCL        VAR(&amp;DATE) TYPE(*CHAR) LEN(6)                
DCL        VAR(&amp;YEAR) TYPE(*CHAR) LEN(4)                
                                                        
RTVJOBA    DATE(&amp;DATE)                                  
CHGVAR     VAR(&amp;YEAR) VALUE(&#039;20&#039; *TCAT %SST(&amp;DATE 1 2)) 
CHGVAR     VAR(&amp;ARKIV) VALUE(&#039;/WORK/ARKIV_&#039; *TCAT &amp;YEAR)
CHKIN      OBJ(&amp;ARKIV)                                  
MONMSG     MSGID(CPFA0A9) EXEC(MD DIR(&amp;ARKIV))          
MONMSG CPFA0DA                                          
                                                        
ENDPGM                                                  
&lt;/pre&gt;

I believe the code is fairly straight forward to understand.

DanF]]></description>
		<content:encoded><![CDATA[<p>Often this requirement is followed by the need to create the folder searched for. From my archives I found this cod
<pre>PGM                                                     
DCL        VAR(&amp;ARKIV) TYPE(*CHAR) LEN(132)             
DCL        VAR(&amp;DATE) TYPE(*CHAR) LEN(6)                
DCL        VAR(&amp;YEAR) TYPE(*CHAR) LEN(4)                
                                                        
RTVJOBA    DATE(&amp;DATE)                                  
CHGVAR     VAR(&amp;YEAR) VALUE('20' *TCAT %SST(&amp;DATE 1 2)) 
CHGVAR     VAR(&amp;ARKIV) VALUE('/WORK/ARKIV_' *TCAT &amp;YEAR)
CHKIN      OBJ(&amp;ARKIV)                                  
MONMSG     MSGID(CPFA0A9) EXEC(MD DIR(&amp;ARKIV))          
MONMSG CPFA0DA                                          
                                                        
ENDPGM                                                  
</pre>
<p>I believe the code is fairly straight forward to understand.</p>
<p>DanF</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bigkat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/#comment-76238</link>
		<dc:creator>bigkat</dc:creator>
		<pubDate>Tue, 20 Apr 2010 14:23:59 +0000</pubDate>
		<guid isPermaLink="false">#comment-76238</guid>
		<description><![CDATA[that should be 
&lt;pre&gt;OBJ(’ifs_path/ifs_object_name&lt;b&gt;&#039;&lt;/b&gt;)&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>that should be </p>
<pre>OBJ(’ifs_path/ifs_object_name<b>'</b>)</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: bigkat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/checking-for-a-folder-in-ifs/#comment-76237</link>
		<dc:creator>bigkat</dc:creator>
		<pubDate>Tue, 20 Apr 2010 14:22:30 +0000</pubDate>
		<guid isPermaLink="false">#comment-76237</guid>
		<description><![CDATA[I use the following for file, you may be able to tweak it for folders

&lt;pre&gt;
CHKIN      OBJ(&#039;ifs_path/ifs_object_name) 
MONMSG     MSGID(CPFA0A9) EXEC(DO)               
  RCVMSG     MSGTYPE(*EXCP)                      
  GOTO       CMDLBL(EXIST)                       
ENDDO      /* CPFA0A9 */                         
GOTO       CMDLBL(NOTEXIST)

EXIST:



NOTEXIST:

&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>I use the following for file, you may be able to tweak it for folders</p>
<pre>
CHKIN      OBJ('ifs_path/ifs_object_name) 
MONMSG     MSGID(CPFA0A9) EXEC(DO)               
  RCVMSG     MSGTYPE(*EXCP)                      
  GOTO       CMDLBL(EXIST)                       
ENDDO      /* CPFA0A9 */                         
GOTO       CMDLBL(NOTEXIST)

EXIST:



NOTEXIST:

</pre>
]]></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 5/8 queries in 0.026 seconds using memcached
Object Caching 311/312 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-19 05:26:32 -->