<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Lexical functions f$time() in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661724#M72306</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is it possible to let f$time write 01, insted of " 1" (leading blank characters)??. I looked at f$cvtime, but could not find any solutions.&lt;BR /&gt;&lt;BR /&gt;I want to include a daynumber in a filename, so blank characters make problems. &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Tue, 01 Nov 2005 05:36:07 GMT</pubDate>
    <dc:creator>geir_2</dc:creator>
    <dc:date>2005-11-01T05:36:07Z</dc:date>
    <item>
      <title>Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661724#M72306</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is it possible to let f$time write 01, insted of " 1" (leading blank characters)??. I looked at f$cvtime, but could not find any solutions.&lt;BR /&gt;&lt;BR /&gt;I want to include a daynumber in a filename, so blank characters make problems. &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 01 Nov 2005 05:36:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661724#M72306</guid>
      <dc:creator>geir_2</dc:creator>
      <dc:date>2005-11-01T05:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661725#M72307</link>
      <description>It appears that F$TIME, F$CVTIME, F$FAO and so on generate a string with a leading space instead of a 0 eg.  1-NOV-2005.&lt;BR /&gt;&lt;BR /&gt;However you can format this yourself&lt;BR /&gt;&lt;BR /&gt;$ now = F$TIME()&lt;BR /&gt;$ d = F$INTEGER(F$CVTIME(now,"ABSOLUTE","DAY"))&lt;BR /&gt;$ m = F$CVTIME(now,"ABSOLUTE","MONTH")&lt;BR /&gt;$ y = F$CVTIME(now,"ABSOLUTE","YEAR")&lt;BR /&gt;$ WRITE SYS$OUTPUT F$FAO("!2ZL-!AS-!AS",d,m,y)&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2005 06:00:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661725#M72307</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-11-01T06:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661726#M72308</link>
      <description>The comparison output format of f$cvtime() does what you want:&lt;BR /&gt;   $ day = f$cvtime(f$time(),"COMPARISON","DAY")&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2005 06:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661726#M72308</guid>
      <dc:creator>David Jones_21</dc:creator>
      <dc:date>2005-11-01T06:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661727#M72309</link>
      <description>&lt;BR /&gt;I realize the problem is solved. The comparision time is always my preferred solution as it sorts. but for similar problems elsewhere you may consider the little used/known left assignment in DCL:&lt;BR /&gt;&lt;BR /&gt;$ x = f$time()&lt;BR /&gt;$ if f$loc(" ",x).eq.0 then x[0,1]="0"&lt;BR /&gt;&lt;BR /&gt;that is...&lt;BR /&gt;&lt;BR /&gt;If the first found space in X is at offset 0, then make 1 byte at offset 0 be an ascii 0.&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2005 08:00:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661727#M72309</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-11-01T08:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661728#M72310</link>
      <description>$ if f$loc(" ",x).eq.0 then x[0,1]="0"&lt;BR /&gt;%DCL-W-IVCHAR, invalid numeric value - check for invalid digits&lt;BR /&gt; \0\&lt;BR /&gt;&lt;BR /&gt;replace "0" by ascii code for 0</description>
      <pubDate>Tue, 01 Nov 2005 09:11:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661728#M72310</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-11-01T09:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661729#M72311</link>
      <description>&lt;BR /&gt;Oops, retype error. Thanks for pointing that out Ian.&lt;BR /&gt;The line should be: &lt;BR /&gt;&lt;BR /&gt;if f$loc(" ",x).eq.0 then x[0,1]:="0"&lt;BR /&gt;&lt;BR /&gt;I hate re-typing and always cut&amp;amp;paste from working examples, but I was experimenting with a new 'T5515 thin client' at home and could not get the Xterm cut&amp;amp;paste to go. Argh.&lt;BR /&gt;&lt;BR /&gt;The := is a string assignment.&lt;BR /&gt;The alternative is just the var[off,len]=val for left bit string assignments.&lt;BR /&gt;&lt;BR /&gt;The suggested solution then becomes:&lt;BR /&gt;&lt;BR /&gt;if f$loc(" ",x).eq.0 then x[0,8]=48&lt;BR /&gt;&lt;BR /&gt;Notice the 8 for 8 bits in a byte.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2005 09:24:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661729#M72311</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-11-01T09:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661730#M72312</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;just another way.&lt;BR /&gt;&lt;BR /&gt;$ zz = f$cvtime(,"ABSOLUTE")&lt;BR /&gt;$ if f$length(f$ele(0," ",zz)).eq.10 then zz = "0''zz'"&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Tue, 01 Nov 2005 11:18:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661730#M72312</guid>
      <dc:creator>Mike Reznak</dc:creator>
      <dc:date>2005-11-01T11:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661731#M72313</link>
      <description>Right... f$cvtime(,"absolute") does not have a leading space, where f$time() does.&lt;BR /&gt;&lt;BR /&gt;Instead of the 'heavy' f$elem construction, Mike could also have just tested length:&lt;BR /&gt;&lt;BR /&gt;$ if f$len(zz)).eq.22 then zz = "0" + zz&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;With the leading space from f$time() you would need:&lt;BR /&gt;&lt;BR /&gt;$ x=f$time()&lt;BR /&gt;$ show symb x&lt;BR /&gt;  X = " 1-NOV-2005 11:31:10.88"&lt;BR /&gt;$ if f$extr(0,1,x).eqs." " then x = "0" + f$ext(1,99,x)&lt;BR /&gt;$ show symb x&lt;BR /&gt;  X = "01-NOV-2005 11:31:10.88"&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;I think we now have sufficiently beaten this horse to death :-).&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2005 12:40:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661731#M72313</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-11-01T12:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661732#M72314</link>
      <description>isn't one of the perl mottos - There is always more than one way to do it&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:-)</description>
      <pubDate>Tue, 01 Nov 2005 12:59:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661732#M72314</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2005-11-01T12:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lexical functions f$time()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661733#M72315</link>
      <description>Hein,&lt;BR /&gt;that's even better. &lt;BR /&gt;I wasn't shure, if there is 0 preceding morning hours in the string. That's why I've suggested F$ELEMENT.&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Wed, 02 Nov 2005 02:28:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/lexical-functions-f-time/m-p/3661733#M72315</guid>
      <dc:creator>Mike Reznak</dc:creator>
      <dc:date>2005-11-02T02:28:53Z</dc:date>
    </item>
  </channel>
</rss>

