Focal Point
[SOLVED] Creating new focus file

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

September 30, 2005, 07:22 PM
Ron R
[SOLVED] Creating new focus file
I am using the following code to concatenate two files into a new focus database. With the SET TEMPERASE=OFF I can find the files in a temporary directory on the report server. Is there a way to redirect the new focus files to a specific directory. I've tried using the FILEDEF command but cannot seem to get it to work.

SET TEMPERASE=OFF
DEFINE FILE TRACKLOG
LOGKEY/A17=LOGKEY;
LOGTOD/A8=LOGTOD;
LOGDATE/A8=LOGDATE;
PROGRAM/A10=PROGRAM;
TAG/A20=TAG;
CLIENT/A10=CLIENT;
IPADDR/A20=IPADDR;
SERVER/A10=SERVER;
BASE/A20=BASE;
END
TABLE FILE TRACKLOG1
PRINT LOGKEY LOGTOD LOGDATE PROGRAM TAG CLIENT IPADDR SERVER BASE
ON TABLE HOLD AS NEWTRACKLOG FORMAT FOCUS
BY LOGKEY
BY LOGTOD
BY LOGDATE
BY PROGRAM
BY TAG
BY CLIENT
MORE
FILE TRACKLOG
END

Thanks,
Ron

This message has been edited. Last edited by: FP Mod Chuck,
September 30, 2005, 07:38 PM
Francis Mariani
Try the USE command, used for FOCUS databases:

USE
D:\path\DBNAME.FOC NEW
END
October 03, 2005, 08:05 PM
Ron R
I tried using the "USE" statement described and I'm still not finding the focus database in the directory entered. It only shows up in the temp directory.

Ron
October 04, 2005, 01:16 AM
Francis Mariani
Let's see your code.

The USE command must state the same db name as the ON TABLE HOLD command.
October 04, 2005, 06:07 AM
susannah
Ron, on my site i have an 8-character limit to the filename of a new focus db.
USE
D:\IBI\path...\NEWTRACK.FOC NEW
END
... make the file
..then
CMD COPY NEWTRACK.MAS D:\IBI\path..\NEWTRACK.MAS /Y
I find copying the masters out of the agent cleaner than using FILDEF HOLDMAST or SET TEMPDIR

PS: I'm wrong about the 8 char limit. that vanished, i just never knew! Smiler
October 04, 2005, 02:21 PM
Francis Mariani
Susannah, have you tried

APP HOLDMETA appname

With this command, HOLD Masters get created in the specified App directory - no FILEDEF HOLDMAST or COPY needed.
October 04, 2005, 02:21 PM
Ron R
It looks like it was a combination of things. I had to change the code so that the database name was the same in the USE and the ON TABLE HOLD statements, and I had change the db name to 8 characters or less. After these changes the .FOC file was created in the correct directory and the .MAS file was created in the temp directory.

Thanks for your help.

Ron
October 04, 2005, 02:33 PM
susannah
Thanks Francis, but i use edapath.
oui, dinosaur, moi.
and i don't filedef holdmast ever because i want to make sure no interim masters get held. I'm guessing an APP HOLDMETA would hold interim masters as well, yes?
and i control my copy with dm so that i only copy on certain conditions.
October 04, 2005, 03:07 PM
Francis Mariani
Yes, unfortunately, APP HOLDMETA holds the interim masters as well. This is annoying. Even more annoying is that it also holds the FOC$HOLD master which, as far as I can remember, can cause problems if it exists in the APP Path.

It would be nice if we could issue the APP HOLDMETA command as ON TABLE APP HOLDMETA appname
October 05, 2005, 09:36 PM
susannah
so,Francis, how about this?
how about app holdmeta to your agent
and then use the dos command to copy your resulting master out of your agent and into wherever you want?
i do it that way to avoid any foc$hold anywhere
i do it like this:
-SET &MYPATH = TEMPPATH(40,'A40');
-* take off that last \ so set tempdir works
-SET &AL = ARGLEN(40,&MYPATH,'I2') -1 ;
-SET &LAL ='A'|&AL;
-SET &MYPATH = SUBSTR(40,&MYPATH,1,&AL,&AL,'&LAL');
and then when i need to absolutely make sure stuff isn't getting written where i dont want it,
FILEDEF HOLDMAST &MYPATH
SET TEMPDIR = &MYPATH
then when i'm good and ready...
COPY &MYPATH|\MYMASTER.MAS D:\IBI\...wherever
you don't even need the mypath in this case, since the agent defaults to the top, but maybe thats an edapath thing. dunno.
This is useful to me in a big etl job where the TEMPDIR has to get set somewhere real at the beginning, and then i want to UNset it later in the job;
Ron, i hope i'm not annoying you with a side conversation in your thread.
July 21, 2017, 03:08 PM
Doug
Excepts from Francis and Susannah:
quote:
Susannah: oui, dinosaur, moi. ...

I'm guessing an APP HOLDMETA would hold interim masters as well, yes?
 
Francis: Yes, unfortunately, APP HOLDMETA holds the interim masters as well. This is annoying. Even more annoying is that it also holds the FOC$HOLD master which, as far as I can remember, can cause problems if it exists in the APP Path.

It would be nice if we could issue the APP HOLDMETA command as ON TABLE APP HOLDMETA appname

Well, the good news is that there is an APP DELETEF command. I would encourage everyone to use APP DELETEF if you do not want the files to be used after the execution of the fex. But, then again, don't use "APP HOLDMETA / APP HOLDDATA" if the HOLD file are only for the current session.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206