Focal Point
[SOLVED] Adding the date to the app hold file name

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

March 23, 2009, 02:48 PM
Johnny-U
[SOLVED] Adding the date to the app hold file name
For some reason I just can't seem to add the current date to the file name of an app hold file

APP HOLD MYFOLDER
i.e. ON TABLE HOLD AS MYOUTPUT_03232009 FORMAT FOCUS

Thanks in advance for your input.
Johnny

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


WebFOCUS 7.1.1
Windows XP
Output: PDF, XLS, and HTML for now
March 23, 2009, 03:00 PM
Prarie
This works. Remember to put APP HOLD whatever
at the beginning

TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE HOLD AS MYOUTPUT_&MDYY FORMAT FOCUS
END


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Johnny,

What error do you receive, if any? Because it could be that the acrual holding of the file is not the problem, but something else is preventing this. If you could provide some more info, we can try and help you solve it.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Well I feel stupid! Thanks Prarie; I never thought I could add the &MDYY and have it come out formatted so nice. I was all over the define and set trying to figure out how to pass the data. Thanks for the fast simple solution!

Johnny-U.


WebFOCUS 7.1.1
Windows XP
Output: PDF, XLS, and HTML for now
PART2:
I thought I could figure this out but I am at another loss. Now that I have some files listed:

MYOUTPUT_09232009.FOC
MYOUTPUT_09242009.FOC
..... and 1 more every 2 weeks

I am trying to use a wild card "MYOUTPUT_*.FOC" or something like that in a USE command so I can append them all into 1 table "MYOUTPUT". I can't seem to be able to use a wild card for this.

Johnny-U


WebFOCUS 7.1.1
Windows XP
Output: PDF, XLS, and HTML for now
No, you can't. But if you know the dates or can do a dir with a wildcard and pipe the output to a file, you can use a -REPEAT loop to read that file and populate the USE.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
Waht you also could do, is writing the name of the hold file to another database (or flatfile or such) at the moment you create it. If you do this in a 'smart' way, the only thing you need to do is to -INCLUDE the flat file in your USE statement.
Suppose you would write to a flat file using APEND at the moment of creation of the hold file:
-WRITE INCFILE MYOUTPUT_&MDYY...FOC AS MYFILE
Then you would only need to do :
USE
-INCLUDE INCFILE
END
and you're done.
(In case you're wondering about the three dots: 2 are for the DM concatenation, the last one is the dot before the extension FOC).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
I use the method that Ginny suggests as with the DIR command with wildcards, you can ensure that you have the latest information or those files that actually exist.

If you combine what Ginny suggests with what GamP suggests then you could create an "include" file post batch that you can use.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
Thank you ALL! I'm working on it as we speak.


WebFOCUS 7.1.1
Windows XP
Output: PDF, XLS, and HTML for now