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] Creating HOLD file to store results from loop
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Creating HOLD file to store results from loop
 Login/Join
 
Silver Member
posted
Good Morning,

I am iterating over a table of guids and preforming some business logic on each. When that's complete, depending on what happened during the business logic, I may push the guid to a results table. It looks like my best, (only?), option is to create a hold using filedef and -WRITE the guid to that file.

A couple Q's:


1. I came across some code which suggests the way to approach this is something like:

FILEDEF RESULTS DISK ????/results.ftm
-RUN

- begin my loop
- do my work

- if I want to write the guid
-WRITE RESULTS &GUID

- end of loop

Does that look right? Do I not need to define a mas file? If that is the right way to go about it I'm getting the following error so maybe I'm missing something?

(FOC339) DIALOGUE MANAGER -READ FAILED: CHECK FILEDEF OR ALLOCATION FOR: RESULTS


2. I learnt a little while ago that if I want my holds to be removed at the end of the request I don't want "ON TABLE HOLD AS 'foccache/temp_hold" but rather "ON TABLE HOLD AS temp_hold" as foccache is session, the other route is for the duration of the request, (feel free to correct me if I'm wrong about that). So with that in mind, where would I want to create this hold if I want it to be deleted at the end of the request? So in the below code, what should "????" be?

FILEDEF RESULTS DISK ????/results.ftm
-RUN

Thanks!

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


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Reply With QuoteReport This Post
Master
posted Hide Post
Hi Sean,

by default foccache is used ( session based storage )

so result.ftm and foccache/result.ftm should be the same.



I have similar code. But I don't use ( nor like :-) ) -WRITE

One of the things that can be done is APPEND.

FILEDEF HOLD DISK HOLD.FTM (APPEND

SET HOLDLIST = PRINTONLY


Then just hold what you need 'do your work'
this could be any dummy request.

begin loop

TABLE FILE CAR
SUM COMPUTE GUID/A255 = 'thisIsNotARealGuid';
BY  COUNTRY
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD FORMAT ALPHA
END


end loop

TABLE FILE HOLD
PRINT *
END



g'luck,


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
so result.ftm and foccache/result.ftm should be the same.

Monday morning brain freeze? result.ftm will go to the foctemp folder for the agent used and not the foccache folder for the user.

If you are only wishing to output certain records from your processing, then look at using PUTDDREC - document .

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5601 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Master
posted Hide Post
...eehm... yeah. But for this case the effect is the same I guess.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Silver Member
posted Hide Post
Works, thanks!


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Creating HOLD file to store results from loop

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