RE: Naming 4GL Report Files with a Date Value
Posted in 1997
LET addfg_file = "/tmp/edcadd/", cur_date, ".rpt" this assignment statement is the problem. you should use: LET addfg_file = "/tmp/edcadd/", cur_date using "yymmdd", ".rpt" James May Database Administrator, Agency for Health Care Administration, Florida voice 904.413.9072 email = mayj@fdhc.state.fl.us }---------- }From: } NILIMA_DESAI@HP-SanJose-om1.om.hp.com[SMTP:NILIMA_DESAI@HP-SanJose-om1.om.hp }.com] }Sent: Monday, August 25, 1997 7:01 PM }To: informix-list@rmy.emory.edu }Subject: Naming 4GL Report Files with a Date Value } }Item Subject: cc:Mail Text } Hello All: } } I have a 4GL program that needs to create a ".rpt" file beginning with } a date value. For example "970825.rpt". I have no problems if I try to } create this file with the TODAY command. However I need to be able to } add 1 to the current date if certain conditions are true. This is } where I have a problem. } } Here is a brief sample of the code in my program and the exact error } message that I get. } } GLOBALS } } DEFINE cur_date date } addfg_file char (80), } part_num char(16), } cur_time datetime hour to second, } cutoff_time datetime hour to second, (this variable stores } the value of the cutoff_time for the IF statement) } addfg_line char(80) } } } LET cur_date = TODAY USING "mmddyy" LET cur_time = CURRENT HOUR TO } SECOND } LET cutoff_time = "17:00:00" (assigns the value of the cutoff_time) } } } IF cur_time > cutoff_time THEN (IF statement defines the value of } cur_date) } LET cur_date = cur_date + 1 } } END IF } } LET addfg_file = "/tmp/edcadd/", cur_date, ".rpt" (assigns the } file-name to this variable) } } } LET addfg_line = "cat >> ", addfg_file CLIPPED (assigns the } command to create and append to the file) } } } START REPORT addfg TO PIPE addfg_line (creates the report file) } OUTPUT TO REPORT addfg () } FINISH REPORT addfg } } } REPORT addfg() } -------------------------- } END REPORT } } } When I use these commands in my program I get the following error } message: } } sh: /tmp/edcadd/: Cannot create the specified file. } } } } If I instead use the command } } LET addfg_file = "/tmp/edcadd/", TODAY using "yymmdd", ".rpt" } } my program works and creates the file for me. } } } I am not sure if this is a problem with the way I am assigning the } value to the cutoff_time or something else. } } I would greatly appreciate any valuable responses. } } Regards, } } Nilima }