Focal Point
permanent hold file

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

July 19, 2007, 12:06 PM
funsutton
permanent hold file
I really don't know how to create a permanent hold file for access by other procedures and such. I know there's a way, but can't find it in the help and I have searched here as well.

Can someone at least point me to the correct item in the help file?


-Brian

Webfocus v7.6.1 on Windows XP
July 19, 2007, 12:31 PM
Tony A
Brian,

If you want the file in one of your APP directories then all you have to do is use APP HOLD [app folder name] before your TABLE request and then APP HOLD afterwards if you are doing more processing that you don't want to have the output from.
APP HOLD BASEAPP
TABLE FILE CAR
SUM RCOST
    DCOST
BY COUNTRY
BY CAR
BY MODEL
-* This file is held in BASEAPP
ON TABLE HOLD AS MYCAR FORMAT FOCUS INDEX COUNTRY CAR MODEL
END
-RUN
APP HOLD
TABLE FILE MYCAR
BY COUNTRY
BY CAR
-* This file does not get held in BASEAPP
ON TABLE HOLD AS NOCAR
END
-RUN


I should mention that this is one of the easier methods, you could use APP FILEDEF or FILEDEF as well, but you would have to work to get your master file as well.

My favorite is to just do a CMD COPY MYCAR.* [drive:]\ibi\apps\baseapp instead. That way you don't get the $foctemp files that are around when you HOLD FORMAT FOCUS.

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 
July 19, 2007, 01:12 PM
funsutton
Thanks Tony. Really appreciate it.

That worked perfectly.

Brian


-Brian

Webfocus v7.6.1 on Windows XP
July 19, 2007, 01:26 PM
Francis Mariani
One small quibble I have with the APP HOLD xxx and APP HOLDDATA xxx commands is that it works just fine in the program that creates the HOLD file. But if you want to read the HOLD file in another WebFOCUS session, you have to execute a FILEDEF command, the APP HOLD xxx command is not enough to tell WebFOCUS where the file is.


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
July 19, 2007, 02:25 PM
TexasStingray
You could always edit the master file description and add the DATASET statement so that you do not have to issue a FILEDEF.




Scott

... or you could APP HOLD it to a folder in your APP PATH and then WF will find it.

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 
and BASEAPP is always in your application path...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

According to iWay Server Administration for UNIX, Windows, OpenVMS, OS/400, OS/390, and z/OS V5.3.2 > Accessing Application Files > Controlling the APP Environment (WF 5.3.2) there is no APP HOLD command, there is the APP HOLDMETA command and the APP HOLDDATA command.

If I use APP HOLD or APP HOLDMETA + APP HOLDDATA to save the master and data file, I still need to issue the FILEDEF command in another session to read the HOLD file - the APP HOLD commands will find the Master, but not the data - which I think is ridiculous.

Program 1a
APP HOLD BASEAPP
-RUN
 
TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS HOLDCAR1
END
-RUN

Program 2a
APP HOLD BASEAPP
-RUN
 
TABLE FILE HOLDCAR1
PRINT
*
END
-RUN


Program 1b
APP HOLDMETA BASEAPP
APP HOLDDATA BASEAPP
-RUN
 
TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS HOLDCAR1
END
-RUN

Program 2b
APP HOLDMETA BASEAPP
APP HOLDDATA BASEAPP
-RUN
 
TABLE FILE HOLDCAR1
PRINT
*
END
-RUN



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
Francis,

The APP HOLD, APP HOLDDATA and APP HOLDMETA are used to direct the hold files not to allow WF to find them. So within the 2a and 2b programs the commands are superfluous.

If you change your programs to HOLD FORMAT FOCUS or XFOCUS then WF should find them OK providing that you directed them to an APP folder within your path. But if you leave them as is then they are basically FTM files for which you generally require a filedef unless that is taken care of within the master (as pointed out by TS).

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 
Francis is right. I nevered noticed this before but when you issue an 'APP HELP' command to list all the APP commands, 'APP HOLD ...' is not listed. However, it seems to work OK. I am using WF 713.

Interesting.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
I wish I was right in expecting the APP HOLD command to find the recently created HOLD file. After all, you don't have to issue a FILEDEF command to create the file, you shouldn't have to to read it. Since ftm is assumed as the suffix when creating the file, why can't it be assumed when reading the file?

It does this with the master without any trouble.


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
Francis,

It sounds like you need to submit a new feature request for this to see what IBI would say. The FILEDEF is automatically done for you when CREATING the HOLD file. That's why you do not need to issue the FILEDEF when creating a HOLD file. However, i'm probably just preaching to the choir (talking to someone who already knows this).


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Here's my input.

There are several way to get the file allocated to a session so that WebFOCUS will find the data.

1.) Add a FILEDEF in the server's global profile.
2.) Add a FILEDEF in each focexec that needs to access the file.
3.) Use the APP to perform the FILEDEF in step 1 or 2 above.
4.) MODIFY the saved master file description and add the DATASET attribute to it.

I personally fill that option 4 would be the best, because to really make the master file description useful you need to add (TITLES, DESCTIPTIONS, a REMARK, and in your case the DATASET attribute). This also will not allocated the file unless it is needed. 1.) If you put the FILEDEF in the server's global profile everyone is allocating it even if it is not needed. 2.) putting the FILEDEF in each of the focexecs that need it is too much work and maintance could turn into a bear. 3.) same as reasons 1, and 2.

The benefit of using your own FILEDEF is that you can use the same master file for different files if they are the same layout, say if you have different files for different weeks, months, or years and you want to allocate it base on what the user selects.

Hope this give everyone some insite.

Have a WebFOCUS Day Smiler




Scott

I like to use a -DOS MOVE command to place the HOLD file in it permanent location. This way the file is only not available for an instant, instead of while the creation process is running. Creating a HOLD FORMAT FOCUS prevents having to do a FILEDEF for the file. Here is a sample of the code I use:

ON TABLE HOLD AS CARHOLD FORMAT FOCUS
END
-RUN

-SET &DATADIR = 'D:\COMMERCIAL\CAGADHOC\JMORROW\DATA';
-SET &TEMPPATH = TEMPPATH (100,'A100');

-SET &INFILE = &TEMPPATH || '\CARHOLD.FOC';
-SET &OUTFILE = &DATADIR || '\CARHOLD.foc';
-DOS MOVE &INFILE.EVAL &OUTFILE.EVAL

-SET &INFILE = &TEMPPATH || '\CARHOLD.MAS';
-SET &OUTFILE = &DATADIR || '\CARHOLD.mas';
-DOS MOVE &INFILE.EVAL &OUTFILE.EVAL

Notes:
• The temppath function returns the server path to the folder pointed to by the app hold command.

• The lower case .foc and .mas means the WebFocus console can find the data sets.


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3