<?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 Re: DCL question in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609331#M39724</link>
    <description>With month = month -1 you convert month from a string symbol to a numeric symbol.&lt;BR /&gt;&lt;BR /&gt;You need to use&lt;BR /&gt;&lt;BR /&gt;$ begin_date[4,2]:="''F$FAO("!2ZL",month)'"&lt;BR /&gt;&lt;BR /&gt;Volker.&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Mar 2010 08:21:05 GMT</pubDate>
    <dc:creator>Volker Halle</dc:creator>
    <dc:date>2010-03-30T08:21:05Z</dc:date>
    <item>
      <title>DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609330#M39723</link>
      <description>I have this written in a COM file&lt;BR /&gt;&lt;BR /&gt;business_date = f$edit(p1,"trim,upcase")&lt;BR /&gt;begin_date = business_date&lt;BR /&gt;end_date = business_date&lt;BR /&gt;&lt;BR /&gt;month = f$extract(4,2,business_date)&lt;BR /&gt;month = month -1&lt;BR /&gt;&lt;BR /&gt;begin_date[4,2]= "''month'"&lt;BR /&gt;show symbol begin_date&lt;BR /&gt;&lt;BR /&gt;on running this COM file, when the input is 20100321, the output is 20102 21.&lt;BR /&gt;what happens is month 03 - 1 = 2.&lt;BR /&gt;what should i do, if i need 02, instead of 2, to look the output as 20100221.</description>
      <pubDate>Tue, 30 Mar 2010 08:10:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609330#M39723</guid>
      <dc:creator>karthikeyan mahalingam</dc:creator>
      <dc:date>2010-03-30T08:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609331#M39724</link>
      <description>With month = month -1 you convert month from a string symbol to a numeric symbol.&lt;BR /&gt;&lt;BR /&gt;You need to use&lt;BR /&gt;&lt;BR /&gt;$ begin_date[4,2]:="''F$FAO("!2ZL",month)'"&lt;BR /&gt;&lt;BR /&gt;Volker.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Mar 2010 08:21:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609331#M39724</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2010-03-30T08:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609332#M39725</link>
      <description>or,&lt;BR /&gt;&lt;BR /&gt;$  If f$len(Month) .lt. 2 then Month = "0''Month'"&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Tue, 30 Mar 2010 09:39:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609332#M39725</guid>
      <dc:creator>The Brit</dc:creator>
      <dc:date>2010-03-30T09:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609333#M39726</link>
      <description>What's this date use for? Have you considered what happens when business_date is 20110121 or 20110331 ?</description>
      <pubDate>Tue, 30 Mar 2010 10:35:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609333#M39726</guid>
      <dc:creator>Graham Burley</dc:creator>
      <dc:date>2010-03-30T10:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609334#M39727</link>
      <description>Yes Graham, &lt;BR /&gt;I have taken care of these cases.&lt;BR /&gt;if the month 01, i change the year and month as well.&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 30 Mar 2010 10:43:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609334#M39727</guid>
      <dc:creator>karthikeyan mahalingam</dc:creator>
      <dc:date>2010-03-30T10:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609335#M39728</link>
      <description>karthikeyan mahalingam,&lt;BR /&gt;&lt;BR /&gt;have you considered / do you have control over the inpt date format?&lt;BR /&gt;If you can input 2010031 as 21-mar-2010, then you have the full functionality of F$CVTIME available. Which includes all kinds of date reckoning.&lt;BR /&gt;&lt;BR /&gt;fwiw&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Tue, 30 Mar 2010 12:00:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609335#M39728</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-03-30T12:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609336#M39729</link>
      <description>karthikeyan,&lt;BR /&gt;&lt;BR /&gt;  Rather than reimplement the convoluted logic of date calculations, I recommend you keep your dates in VMS ABSOLUTE format and use F$CVTIME to do the date arithmetic.&lt;BR /&gt;&lt;BR /&gt; For example, the day before DATE is:&lt;BR /&gt;&lt;BR /&gt;$ day_before=F$CVTIME("''date'-1-","ABSOLUTE","DATE")&lt;BR /&gt;&lt;BR /&gt; Once you've found your target date, you can convert it to julian format with:&lt;BR /&gt;&lt;BR /&gt;$ jdate=F$CVTIME(date,,"DATE")-"-"-"-"&lt;BR /&gt;&lt;BR /&gt;Converting a julian date to an absolute date is:&lt;BR /&gt;&lt;BR /&gt;$ date=F$FAO("!UL-!AS-!4AS",F$INTEGER(F$EXTRACT(6,2,jdate)),F$ELEMENT(F$EXTRACT(4,2,jdate),"|","|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|"),F$EXTRACT(0,4,jdate))&lt;BR /&gt;&lt;BR /&gt;To get DAY, MONTH and YEAR as numbers:&lt;BR /&gt;&lt;BR /&gt;$ DAY=F$INTEGER(F$CVTIME(DATE,,"DAY"))&lt;BR /&gt;$ MONTH=F$INTEGER(F$CVTIME(DATE,,"MONTH"))&lt;BR /&gt;$ YEAR=F$INTEGER(F$CVTIME(DATE,,"YEAR"))&lt;BR /&gt;&lt;BR /&gt;To convert DAY, MONTH and YEAR back to julian format, use F$FAO:&lt;BR /&gt;&lt;BR /&gt;$ jdate=F$FAO("!4ZL!2ZL!2ZL",YEAR,MONTH,DAY)&lt;BR /&gt;&lt;BR /&gt;In the control string for F$FAO "!" means a formatting directive follows, the next number is the field width and "ZL" means "Zero filled Longword integter"</description>
      <pubDate>Tue, 30 Mar 2010 19:57:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609336#M39729</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-03-30T19:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609337#M39730</link>
      <description>And if you're going to be doing date math on your own (and if that local implementation can be avoided in favor of using system routines,  then do avoid it), you will also get to deal with leap year and with the two daylight saving time changes.</description>
      <pubDate>Tue, 30 Mar 2010 22:57:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609337#M39730</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-03-30T22:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609338#M39731</link>
      <description>I am really overwhelmed with the answers posted. Thank you everybody for this wonderful forum community.</description>
      <pubDate>Wed, 31 Mar 2010 02:56:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609338#M39731</guid>
      <dc:creator>karthikeyan mahalingam</dc:creator>
      <dc:date>2010-03-31T02:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609339#M39732</link>
      <description>i hope this will help&lt;BR /&gt;&lt;BR /&gt;month_str = "00" + month&lt;BR /&gt;&lt;BR /&gt;month_str =f$extract(f$length(month_str)-2,f$length(month_str),month_str)&lt;BR /&gt;! will always give two digits. if month is digit then 0 is displayed along els eif two, then only the two digit month number is dispalyed.</description>
      <pubDate>Wed, 07 Apr 2010 07:37:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609339#M39732</guid>
      <dc:creator>sathya prabu</dc:creator>
      <dc:date>2010-04-07T07:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609340#M39733</link>
      <description>For the stated zero-fill padding, the following is vastly less work:&lt;BR /&gt;&lt;BR /&gt;x = f$fao("!2ZW", month)&lt;BR /&gt;&lt;BR /&gt;Timekeeping and time values are an area that almost certainly will encounter problems when manually parsing and manipulating values; time and timekeeping does look simple, but it's replete with corner cases.  Whether involving month or year boundary cases, or with leap year, with the two switches related to daylight saving time, calculations with UTC or such, or with centuries.  These are only some of the errors I've encountered, too. &lt;BR /&gt;&lt;BR /&gt;Use the system routines to manage time and time values whenever you can.  Don't roll your own where you can avoid it.</description>
      <pubDate>Wed, 07 Apr 2010 16:23:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609340#M39733</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-04-07T16:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: DCL question</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609341#M39734</link>
      <description>From, sometimes bitter, experience, I can only strongly support Hoff's statement.&lt;BR /&gt;&lt;BR /&gt;The sites I have encountered which had their own "smart" time routines; and when they ran into some "issue" I was called in to find the cause -- and explain !!!&lt;BR /&gt;Bottom line:&lt;BR /&gt;a number of REALLY smart guys/galls have spent serious effort to get it right - USE SYSTEM supplied date-time functions!&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Wed, 07 Apr 2010 16:58:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dcl-question/m-p/4609341#M39734</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2010-04-07T16:58:11Z</dc:date>
    </item>
  </channel>
</rss>

