At 04:41 PM 1/3/2002 -0600, Joe M Andress wrote:
Dear Joe,
If you visit our website at:
http://www.robelle.com/tips/suprtool.html
There is an article on how to do this very same thing, it is near the end
of this page. I have cut and pasted the article in however,
the formatting is slightly better on the web page.
One common business task is to generate a date value that is N-days before
or after another date value in your database.
For example, FOLLOWUP-DATE might need to be a week after SHIPPED-DATE. With
the new $Days function in Suprtool, you can easily generate a date that is
N-days before or after any date. You only need to use two Suprtool tasks.
The input date can be in any supported format, but the output date will be
in yyyymmdd format.
The first task generates the desired date, but it will be in Julianday
format. For simplicity, we assume that the file only contains the date, in
yyyymmdd X8 format.
>input YOURFILE
>def shipped-date,1,8
>item shipped-date,date,yyyymmdd
>def jdate,1,4,int
>item jdate,date,julianday
>ext shipped-date
>ext jdate = $days(shipped-date) + 7
>out tmpfile,link
>xeq
The second task converts the Julian-format date to yyyymmdd format.
>in tmpfile
>def followup-date,1,8,display
>item followup-date,date,yyyymmdd
>ext shipped-date
>ext followup-date = $stddate(jdate)
>out result,link
>xeq
Now you have a self-describing file with the following information
SHIPPED FOLLOWUP
19981231 19980107
19991230 19990106
19990228 19990307
Sincerely,
Neil Armstrong
Robelle
>HI
>
>I have a desire to perform the following type of SUPRTOOL pseudo-activity
>
>
>
>ITEM YMDEFF,DATE,YYYYMMDD {date item as X(08) in form of YYYYMMDD}
>ITEM YMDHIRE,DATE,YYYYMMDD {data item as X(08) in form of YYYYMMDD)
>
>EXTRACT YMDHIRE = $DATE(YMDEFF) - 30
>
>
>I know this is not correct but the desired impact is to calculate a data
>item that is 30 (days) prior to the value of the value of YMDEFF. Both
>YMDEFF and YMDHIRE are data items the same data set, defined as X(08)
>items whereby the values are in the format of YYYYMMDD.
>
>Any thoughts on SUPRTOOL being able to perform this type of activity in
>either one or multiple task would be greatly appreciated.
>
>Regards
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|