Dates in Strings

Darren Reely darren_reely@latticesemi.com
Mon, 19 Oct 1998 15:16:48 -0700


Hi All,

I'm trying to build a string in Quiz so on a single header line the
output will look like:

   ProdClass TProduct 16V8D-15QJ  Ship Date Range: From MAR-22-1998  To
OCT-19-1998  Cust Name John Doe

Below is some test code that works.  Is there an easier way to get the
dates in that long format from date types?  I thought there was a way to

directly get the character month from a date, but can't find it under
Sun.  Maybe I'm thinking about VMS Lexicals.

I'm using Powerhouse 8.13.C on Sun Solaris 2.5.  I'm looking at cutting
down my work load for our Y2K project.

Thanks,

Darren Reely


set page width 132

define p_from_ship_date date = parm prompt "From Date: "
define p_to_ship_date date = parm prompt "To Date: "

define d_LatMonthStr char*36 = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"

define d_from_ship_month char*3 &
     = d_LatMonthStr[(dateextract(p_from_ship_date, MONTH) * 3) - 2 :3]
define d_to_ship_month char*3 &
     = d_LatMonthStr[(dateextract(p_to_ship_date, MONTH) * 3) - 2 :3]

define prod_type char*6 = "T"
define p_product char*16 = "16V8D-15QJ"
define p_cust_name char*25 = "John Doe"

define d_selects char*100 = &
  "ProdClass " + truncate( prod_type ) &
  + "Product " + truncate( p_product ) &
  + "  Ship Date Range: From " + d_from_ship_month + "-" &
                              + ascii(p_from_ship_date,8)[7:2] + "-" &
                              + ascii(p_from_ship_date,8)[1:4] &
  + "  To " + d_to_ship_month + "-" &
            + ascii(p_to_ship_date,8)[7:2] + "-" &
            + ascii(p_to_ship_date,8)[1:4] &
  + "  Cust Name " + trunc(p_cust_name)

report d_selects


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.