Focal Point
[CLOSED] Saving file to folder with space

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5797030006

March 10, 2011, 01:49 PM
MikeW
[CLOSED] Saving file to folder with space
I'm trying to save a file to a location on a network drive. This location has a space in the name of a certain folder. I got the file to save successfully bby putting the whole path in double quotes but now they want the date on the end of the file and it's causing issues with it saving. I've pasted what I have below but it doesn't work. I even tried putting double quotes around the whole thing and still no luck. Any ideas?

-SET &DTSTAMP = EDIT(&MDYY,'99999999') ;
-SET &OUTFILE = 'D:\IBI\EXPORTS\LISA\mark tripp' || &DTSTAMP || '.txt';
FILEDEF RESULTS DISK &OUTFILE

This message has been edited. Last edited by: Kerry,


Webfocus 8.1.0.5
Windows 2008
Excel,PDF,HTML
March 10, 2011, 03:22 PM
Waz
Try with quotes in the string.
-SET &OUTFILE = '"D:\ibi\mark tripp' || &DTSTAMP || '.txt"';



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 10, 2011, 03:31 PM
MikeW
Thanks for your response but that didn't work either. It returned the error of "ERROR WRITING OUTPUT FILE: RESULTS" I can get it to work just fine on a location where there's no space in the path but the owners dont want to remove the space in their folder.


Webfocus 8.1.0.5
Windows 2008
Excel,PDF,HTML
March 10, 2011, 04:18 PM
jfr99
Hi MikeW,

I had to put double quotes around the OUTFILE variable to get the filedef to work.

FILEDEF RESULTS DISK "&OUTFILE"

Let me know if that helps.

Jim


WebFocus 8.201M, Windows, App Studio
March 10, 2011, 04:41 PM
MikeW
I still got the same error, I tried the quotes around the amper variable like you suggested. Frowner


Webfocus 8.1.0.5
Windows 2008
Excel,PDF,HTML
March 10, 2011, 04:51 PM
jfr99
Is the space just in the file name(as in your example) or is there also a space in the folder name?


WebFocus 8.201M, Windows, App Studio
March 10, 2011, 04:52 PM
Tom Flynn
Try it with .EVAL. Also, make sure you have write access to the disk, and, the path is correct. And, you don't need the EDIT.

This worked for me:

  
APP PREPENDPATH IBISAMP
-RUN
-SET &ECHO=ALL;
SET SHOWBLANKS = ON
-RUN
-SET &OUTFILE = 'D:\ibi\64bit\apps\bi_adv\tflynn' || '&MDYY.EVAL' || '.txt';
FILEDEF RESULTS DISK &OUTFILE
? FILEDEF
-RUN
TABLE FILE CAR
PRINT
  COUNTRY  
  CAR  
  MODEL  
  COUNTRY  
  CAR  
  MODEL  
 ON TABLE SAVE AS RESULTS
END
-EXIT

and created: tflynn03102011.txt


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 10, 2011, 04:56 PM
Francis Mariani
-SET &OUTFILE = 'C:\ibi\apps\baseapp\test test' | &MDYY | '.txt';
FILEDEF RESULTS DISK "&OUTFILE"
-RUN
-WRITE RESULTS XXXXXXXXXXX

This works in my Windows environment.

You have to make sure that "D:\ibi\" actually exists on the server where WebFOCUS runs.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 10, 2011, 05:41 PM
Waz
Can you try one of the examples with -SET &ECHO=ALL;

and post the results.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!