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     [CLOSED]Creating master file programmatically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Creating master file programmatically
 Login/Join
 
Member
posted
I start out creating a folder for the project and issue these commands

APP PREPENDPATH USERPRJ
APP HOLD USERPRJ
APP HOLDMETA USERPRJ
APP SHOWPATH

run my fex to create a table with the data i need in the master

-*
TABLE FILE MASTER_LIST
COUNT * AS NUM_STU_ALL_CLASSES
PRINT
STC_PERSON_ID
STC_TERM
STC_CRED
STC_STATUS_DATE
COURSES_ID
SEC_INSTR_METHODS
STC_CRED
OL_FLAG
OL_CREDS
TOT.STC_CRED AS NUM_STU_ALL_CREDS
TOT.OL_CREDS AS NUM_STU_OL_CREDS
TOT.OL_FLAG AS NUM_STU_OL_CLASSES
BY SEC_TERM
BY STC_STATUS_DATE
WHERE STC_TERM CONTAINS '&ACAD_TERM'
WHERE (((POS EQ 1) AND (STC_STATUS EQ 'A' OR 'N')) OR ((STC_VERIFIED_GRADE NE MISSING) OR (STC_VERIFIED_GRADE GT ' ')))
ON TABLE HOLD AS TED
-*ON TABLE PCHOLD FORMAT EXL2K
END
-*S-EXIT
-*
-*
WHENCE TED MASTER

-EXIT



but when i try to run a fex using the newly created master i get this error

0 ERROR AT OR NEAR LINE 8 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC226) FILEDEF OR ALLOC MISSING FOR EXTERNAL FILE: TED

from running this

APP PREPENDPATH USERPRJ
APP HOLD USERPRJ
APP HOLDMETA USERPRJ
APP SHOWPATH
TABLE FILE TED
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END



Can someone point me to anything on how to programmatically create a master file that can be used by other fex's?

thanks

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Expert
posted Hide Post
quote:
(FOC226) FILEDEF OR ALLOC MISSING FOR EXTERNAL FILE: TED

Nothing wrong with your master file, you just need to tell WebFOCUS where your data file is!

The error message is telling you that it is not FILEDEFd or ALLOCd.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
quote:
APP HOLD USERPRJAPP HOLDMETA USERPRJ

BTW,
  • APP HOLD places both data file and master file in the specified folder.
  • APP HOLDMETA only places the master file in the specified folder.
  • APP HOLDDATA only places the data file in the specified folder.

So you only need APP HOLD to hold both files produced by your focexec.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
OK, I changed the command to
APP HOLD USERPRJ
and it creates a .mas file in the directory (as it had been), but I still get the (FOC226) FILEDEF OR ALLOC MISSING FOR EXTERNAL FILE: TED
error.

I was expecting top see a .acx file with the same name. Is that what I should see?


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Expert
posted Hide Post
You wouldn't get an access file (acx) with a HOLD, as it isn't required for just a basic binary HOLD file.

The answer to your question is still in the message "FILEDEF or ALLOC is missing". Look up FILEDEF and you should comprehend what the error message is telling you.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
ALC,

Apparently, you would like to have the FILEDEF written somewhere.
You can put it in the MASTER file with the DATASET attribute.
I suppose, however, that you would like this to be done automatically...
So, a bit of FOCUS wizardry:
  
-SET &ECHO=ALL;
-* File alc01.fex
-DEFAULT &APPH=userprj
APP HOLD &APPH
TABLE FILE CAR
SUM CNT.CAR AS CARCNT
SUM SALES
BY COUNTRY BY BODYTYPE
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS EXT
END
-RUN
FILEDEF MAS DISK &APPH/ext.mas 
FILEDEF NMAS DISK &APPH/next.mas 
-RUN
-SET &I=0;
-#LOOP
-SET &I = &I + 1;
-SET &G=DECODE &I(1 #F 2 #S ELSE #N);
-GOTO &G.EVAL
-#F
-* File definition
-READ MAS,&LL1,&LL2,&LL3
-IF &IORETURN GOTO #DONE;
-SET &LL3='DATASET=' || &APPH || '/EXT.FTM';
-WRITE NMAS &LL1, &LL2, &LL3, $
-GOTO #LOOP
-#S 
-* Segment definition
-READ MAS,&LL1,&LL2
-IF &IORETURN GOTO #DONE;
-WRITE NMAS &LL1, &LL2, $
-GOTO #LOOP
-#N
-* Field definition
-READ MAS,&LL1,&LL2,&LL3,&LL4
-IF &IORETURN GOTO #DONE;
-WRITE NMAS &LL1, &LL2, &LL3, &LL4, $
-GOTO #LOOP
-#DONE
!del C:\IBI\APPS\&APPH|\ext.mas
!rename C:\IBI\APPS\&APPH|\next.mas ext.mas


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Does the failing fex include this line:?
APP PREPENDPATH USERPRJ


Because if it doesn't, that would explain why the master can't be found. Unless USERPRJ is in your server (or Dev/App-studio) path, then you don't need that line anywhere.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Wep,
The problem is not the master it is the data.
A FILEDEF is necessary when running against a sequential file.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
Remember an agent has it's own thread and holds etc disappear after the agent finishes unless you do something to move things out of the temporary space.


8.0.1
 
Posts: 7 | Registered: August 22, 2016Report This Post
Member
posted Hide Post
Our administrator did add the directory to the path, but that was because InfoAssist needed it.


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Member
posted Hide Post
quote:
ON TABLE HOLD AS TED

was update to
ON TABLE HOLD AS TED FORMAT FOCUS, and it looks like everything works. I was under the impression that format focus was the default for hold files, but after reading lots of help the default may in fact be binary. I want to test a few more things, but at least i'm making progress

Thanks everyone


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 28 | Registered: April 27, 2010Report This Post
Master
posted Hide Post
The default for hold files is Alpha. Less overhead. Basically a space delimited text file.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report 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     [CLOSED]Creating master file programmatically

Copyright © 1996-2020 Information Builders