Informix 4gl pgm to reformat dates to Month dd, yyyy
Posted in 1998
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I was not able to find any formatting that would format dates to show the month spelled out so I wrote the following pgm. If there is any other programs that already do the same please reply. Kirby Ramsey, Visual Services Inc., Bloomfield Hills, MI function date_rtn(in_date) define prt_date char(8), in_date date, prt_mth,prt_day char(2), prt_yr char(4), prt_month char(10), print_date, new_db,sw_type char(20) let prt_date = in_date using "mmddyyyy" let prt_mth = prt_date[1,2] let prt_day = prt_date[3,4] let prt_yr = prt_date[5,8] if prt_day[1,1] = "0" then let prt_day = " ", prt_day[2,2] end if call date_month(prt_mth) returning prt_month let print_date = prt_month clipped," ",prt_day,", ",prt_yr return(print_date) end function function date_month(prt_mth) define prt_mth char(2), prt_month char(10) if prt_mth = "01" then let prt_month = "January" end if if prt_mth = "02" then let prt_month = "February" end if if prt_mth = "03" then let prt_month = "March" end if if prt_mth = "04" then let prt_month = "April" end if if prt_mth = "05" then let prt_month = "May" end if if prt_mth = "06" then let prt_month = "June" end if if prt_mth = "07" then let prt_month = "July" end if if prt_mth = "08" then let prt_month = "August" end if if prt_mth = "09" then let prt_month = "September" end if if prt_mth = "10" then let prt_month = "October" end if if prt_mth = "11" then let prt_month = "November" end if if prt_mth = "12" then let prt_month = "December" end if return(prt_month) end function