Re: Naming 4GL Report Files with a Date Value
Posted in 1997
NILIMA_DESAI@HP-SanJose-om1.om.hp.com wrote: Your problem is misuse of USING. > > > GLOBALS > > DEFINE cur_date date > > LET cur_date = TODAY USING "mmddyy" misuse above. cur_date is a DATE value, not a CHAR, which is when USING is evaluated. in this case, you're getting away with it, but the USING statement above isn't doing anything to change cur_date. Prove it by adding DISPLAY cur_date just below, and you'll see the date displays in the format of DBDATE environment variable (default mm/dd/yyyy) > > LET addfg_file = "/tmp/edcadd/", cur_date, ".rpt" do DISPLAY addfg_file here and you'll see /tmp/edcadd/09/03/1997.rpt. A perfectly legitimate directory path (though the sub directories don't exist), but not what you want. Change to: LET addfg_file = "/tmp/edcadd/", cur_date USING "mmddyy", ".rpt" and all will be well. In this case, we're setting a character string to the value of the date, so USING is appropriate. > > LET addfg_line = "cat >> ", addfg_file CLIPPED (assigns the > command to create and append to the file) > > > START REPORT addfg TO PIPE addfg_line This could also be written: START REPORT addfg TO addfg_file ( or START REPORT addfg TO FILE addfg_file, depending on 4GL version), thus avoiding all that addfg_line stuff. //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-843-6408 and do not necessarily //////////////// http://www.informix.com reflect those of my employer