Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Saving file to sytem directry with date extention
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Saving file to sytem directry with date extention
 Login/Join
 
Gold member
posted
Hi

I`m trying to create a file to one of the application directory with following code, my requirement is to create the file with date as extension, but I`m getting error if I leave a space between file name and the date, if I give a space then job is finishing but file was not creating at the target location.

Any help on this appreciated.
 
-SET &TS=HHMMSS('A8');
-SET &&DATE = &DATE;

FILEDEF SAVEOUT DISK FTP/CAR_FILE_FTP-&DATE.xls

TABLE FILE CAR
PRINT CAR
BY COUNTRY

ON TABLE SAVE AS SAVEOUT FORMAT EXL2K
ON TABLE SET EMPTYREPORT ON
ON TABLE SET STYLE *
     PAGESIZE='Letter',
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT, TITLETEXT='CAR FILE DAILY FTP', $
TYPE=REPORT,FONT='ARIAL',SIZE=8,COLOR='BLACK',GRID=OFF,BORDER-COLOR='GRAY',$
TYPE=TITLE, STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE', JUSTIFY=CENTER,BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=DATA,BACKCOLOR=('WHITE' RGB(240 240 240)), BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=ACROSSVALUE,JUSTIFY=CENTER,STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE',BORDER=LIGHT, BORDER-COLOR='GRAY',$
TYPE=GRANDTOTAL, BACKCOLOR=RGB(215 215 215), STYLE=BOLD,BORDER-TOP=HEAVY,BORDER-TOP-STYLE=DOUBLE, BORDER=LIGHT, BORDER-COLOR='GRAY',$
ENDSTYLE
END
-EXIT
 

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 88 | Registered: September 20, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
And something such as this ?
TABLE FILE CAR
PRINT CAR
BY COUNTRY

ON TABLE HOLD AS FTP/CAR_FILE_FTP_&YYMD FORMAT XLSX
ON TABLE SET EMPTYREPORT ON
ON TABLE SET STYLE *
     PAGESIZE='Letter',
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT, TITLETEXT='CAR FILE DAILY FTP', $
TYPE=REPORT,FONT='ARIAL',SIZE=8,COLOR='BLACK',GRID=OFF,BORDER-COLOR='GRAY',$
TYPE=TITLE, STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE', JUSTIFY=CENTER,BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=DATA,BACKCOLOR=('WHITE' RGB(240 240 240)), BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=ACROSSVALUE,JUSTIFY=CENTER,STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE',BORDER=LIGHT, BORDER-COLOR='GRAY',$
TYPE=GRANDTOTAL, BACKCOLOR=RGB(215 215 215), STYLE=BOLD,BORDER-TOP=HEAVY,BORDER-TOP-STYLE=DOUBLE, BORDER=LIGHT, BORDER-COLOR='GRAY',$
ENDSTYLE
END
-EXIT


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 1878 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
Hi Martin,

Thank you, that worked but the format we are looking for is "jan-19", how can I get that?

Thanks,
Krishna


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 88 | Registered: September 20, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
This could be one option.
DEFINE FILE CAR
DTE    /YYMD = &YYMD;
DTEMTH /Mt   = DTE;
DTEYR  /Y    = DTE;
DTEMY  /A6V  = FPRINT(DTEMTH, 'Mt', 'A3') || '-' || EDIT(DTEYR);
END
TABLE FILE CAR
PRINT DTEMY
BY COUNTRY NOPRINT
WHERE READLIMIT EQ 1;
ON TABLE HOLD AS DTESAV
END
-RUN
-READFILE DTESAV
-RUN
-DEFAULTH &DTEMY = ''

TABLE FILE CAR
PRINT CAR
DTEMTH
DTEYR
DTEMY
BY COUNTRY

ON TABLE HOLD AS FTP/CAR_FILE_FTP_&DTEMY FORMAT XLSX
ON TABLE SET EMPTYREPORT ON
ON TABLE SET STYLE *
     PAGESIZE='Letter',
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT, TITLETEXT='CAR FILE DAILY FTP', $
TYPE=REPORT,FONT='ARIAL',SIZE=8,COLOR='BLACK',GRID=OFF,BORDER-COLOR='GRAY',$
TYPE=TITLE, STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE', JUSTIFY=CENTER,BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=DATA,BACKCOLOR=('WHITE' RGB(240 240 240)), BORDER=LIGHT,BORDER-COLOR='GRAY',$
TYPE=ACROSSVALUE,JUSTIFY=CENTER,STYLE=BOLD,BACKCOLOR=RGB(86 160 211),COLOR='WHITE',BORDER=LIGHT, BORDER-COLOR='GRAY',$
TYPE=GRANDTOTAL, BACKCOLOR=RGB(215 215 215), STYLE=BOLD,BORDER-TOP=HEAVY,BORDER-TOP-STYLE=DOUBLE, BORDER=LIGHT, BORDER-COLOR='GRAY',$
ENDSTYLE
END
-EXIT


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 1878 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Expert
posted Hide Post
 
This could be another option.
-SET &MonthYear = &DATEMt || '-' || &DATEY ;
before the TABLE FILE... to get "Jan-19" as in
ON TABLE HOLD AS FTP/CAR_FILE_FTP_&MonthYear.EVAL FORMAT XLSX


   In FOCUS Since 1983 ~ from PC FOCUS to WebFOCUS.
   Currrently using 8204 Gen 48 in Test and Production.
   KGPCo at CenturyLink. October 2017 to Present...
 
Posts: 2797 | Location: Nashville TN Area [Test&Prod:8204Mg48] | Registered: February 23, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Awesome! that worked, thank you Martin and Doug.

Thanks,
Krishna.


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 88 | Registered: September 20, 2010Reply With QuoteReport This Post
Master
posted Hide Post
From the original post, this FILEDEF will work

FILEDEF SAVEOUT DISK FTP/CAR_FILE_FTP-&DATE...xls

As a side note when mixing amper variables with text string it is a good idea to always test with:
-SET &ECHO=ALL;
-SET &STACK=OFF;

This way you can see the resulting code without running the TABLE request.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 873 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Saving file to sytem directry with date extention

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.