Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Saving file to sytem directry with date extention
 Login/Join
 
Platinum 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: 106 | Registered: September 20, 2010Report 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.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum 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: 106 | Registered: September 20, 2010Report 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.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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 FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
Awesome! that worked, thank you Martin and Doug.

Thanks,
Krishna.


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report 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: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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-2020 Information Builders