August 30, 2007, 04:16 PM
Got2FocusProblem writing to directory with long full path and filename
Hello,
I am having a problem writing a file to a particular directory. The full path is very long. When I shorten the filename, the program executes successfully. When I run it as shown below, it executes with no errors but does not write the file to the specified directory.
Question: Is there a limit on the number of characters for the full path + filename? Is there a limit on the numbers of characters that can be passed to a variable using the -SET command?
Thanks in advance,
-SET &STATEL = '\\serverl7\MwProd\WebReports\Group\26+Reports\Central\StateLaw\STATELAW_CENTRAL_ANNV10_GRP123456_08302007.PDF';
FILEDEF &STATEL DISK &STATEL
-********************
SET HOLDLIST = ALL
TABLE FILE MED2
SUM
MD_CON
MD_MBR
CL_RXMED
PR_RXMED
DEN_CON
DEN_MBR
DEN_PAID
DEN_INC
BY FIN_CYCLE_DT
HEADING
"PAID CLAIMS BY MONTH"
FOOTING
"Report statelaw"
"Produced on <+0>&DATEtrMDYY <+0> "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE FILENAME
&STATEL
FORMAT PDF
----------------------------------
WF 7.1.3 ; Windows XP; DB2
August 31, 2007, 04:20 AM
hammo1jUse double quotes round the filename.
SET &STATEL = '"\\serverl7\MwProd\WebReports\Group\26+Reports\Central\StateLaw\STATELAW_CENTRAL_ANNV10_GRP123456_08302007.PDF"';
FILEDEF &STATEL DISK &STATEL
August 31, 2007, 09:29 AM
cburttThe normal use of FILEDEF is "FILEDEF
DISK ". The command makes a relationship between the full path to a file, the 'external name' by which it is known to the OS, and a short nickname for the file, the 'internal name' by which it can be referenced by the executing FOCUS application. You don't need the 1st "&STATEL". It can be replaced with a 'hard coded' short name.
This would work as well:
FILEDEF DOG DISK &STATEL
which would be combined with:
ON TABLE SAVE SAVE AS DOG
August 31, 2007, 09:33 AM
cburttSorry about the content of my previous post. I used angular brakets (gt,lt characters) in my representation of the syntax, and it got "gobbled up" by html as tags. Here it is again with different brackets: "FILEDEF [internalname] DISK [externalname]".
August 31, 2007, 10:34 AM
EricHI'm on 7.62, and this worked for me:
-SET &FILENAME = 'C:\ibi\apps\MwProd\WebReports\Group\26+Reports\Central\StateLaw\a-very-very-very-very-very-very-very-long-folder-name\STATELAW_CENTRAL_ANNV10_GRP123456_08302007.PDF';
FILEDEF MYHOLD DISK &FILENAME
-RUN
TABLE FILE CAR
PRINT CAR BY COUNTRY
ON TABLE HOLD AS MYHOLD FORMAT PDF
END
-RUN
August 31, 2007, 11:07 AM
Got2FocusERICH, YOUR METHOD WORKED PERFECTLY FOR ME!
BIG THANKS TO HAMMO1J AND CBURTT FOR YOUR RESPONSES.
THANKS AGAIN!!!