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.
Hi, Using a Maintain, I'm trying to save selective data from many records to a flat file to be exported to another application. Using a TYPE ON ddname requires a filedef. So I placed the filedef in a fex and "EXEC thefex" from Maintain.
Maintain gives error FOC03799 open for file: ddname : failed.
Another technique would be to collect data in another FOCUS DB, Table and save to flat file. This is the "fall back".
Any ideas?
Thank you, NickThis message has been edited. Last edited by: Dr. Nick,
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Running an EXEC will not affect anything in the maintain session you are running; the focexec runs on a different agent and has no knowledge of the calling maintain and cannot affect it.
You should have the filedef in EDASPROF.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Alan is right. The filedef must be done before the maintain starts, otherwise you will not be able to use it. Only on mainframe it is possible to dynamically allocate a resource from within the maintain procedure. On all other platforms you have to do it outside of and before starting the maintain.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
MAINTAIN FILE CAR
DECLARE FIRST_REC/A1;
DECLARE THIS_RECORD/A80;
DECLARE STACK_ROW/I4;
CASE TOP
FOR ALL NEXT COUNTRY CAR INTO CARSTACK;
FIRST_REC= 'Y';
WINFORM SHOW FORM1
ENDCASE
CASE WRITE_RECORD
THIS_RECORD = CARSTACK(STACK_ROW).COUNTRY | ',' | CARSTACK(STACK_ROW).CAR | ',$' ;
EXEC WRITE_FEX KEEP FROM FIRST_REC THIS_RECORD;
FIRST_REC= 'N';
ENDCASE
END
with
-* File WRITE_FEX.fex
-SET &APP = IF &1 EQ 'N' THEN '(APPEND' ELSE ' ';
APP FI WFILE CLEAR
APP FI WFILE DISK BASEAPP/WFILE.TXT &APP.EVAL
-RUN
-WRITE WFILE &2
depending on what you are trying to achieve.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Nick As the gentlemen point out, you really have to do the FILEDEF in the EDASPROF. However, if you need to write out a flat file and use it in the same session as the Maintain procedure, use the TEMPPATH command.
Here, case SENDDATA performs a Maintain called WRITER that writes the selected values out to a flatfile called SEL. I have already FILEDEF'D SEL in my EDASPROF. It passes back the TEMPPATH in the variable PTH. I can then perform TABLE1 and pass the path back so I can find the SEL file to use as criteria.
Mark
CASE SENDDATA COMPUTE PTH/A256; COMPUTE I/I3=1; REPEAT OUTSTK.FOCCOUNT Compute OUTSTK(I).CAT = "'" || OUTSTK(I).CAT ||"'"; Compute I=I+1; ENDREPEAT STACK CLEAR HTMLSTK CALL WRITER FROM OUTSTK INTO PTH EXEC TABLE1 FROM PTH INTO HTMLSTK ENDCASE
Note, I added a PTH or Path variable. Now, the child Maintain writes the file, but also knows the path that it wrote to and passes it back.
MAINTAIN FROM OUTSTK INTO PTH COMPUTE HTMLSTK.HTML/A2000; COMPUTE outstk.cat/a15; COMPUTE I/I3=1; REPEAT outstk.FOCCOUNT TYPE ON SEL "< COMPUTE I=I+1; ENDREPEAT COMPUTE PTH/A256 = TEMPPATH(256,PTH); END
-SET &Q = &1 || SEL.DAT FILEDEF SEL DISK &Q ? FILEDEF -RUN TABLE FILE MOVIES PRINT TITLE BY CATEGORY WHERE CATEGORY IN FILE SEL ON TABLE PCHOLD FORMAT HTML END -RUN
Posts: 663 | Location: New York | Registered: May 08, 2003