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     [SOLVED] MAINTAIN - TYPE ON DDNAME

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MAINTAIN - TYPE ON DDNAME
 Login/Join
 
Gold member
posted
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,
Nick

This 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.
 
Posts: 83 | Registered: February 26, 2009Report This Post
Expert
posted Hide Post
Does thefex run if you run it standalone ?

What is the format of the FILEDEF ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Hi Waz,
Tested the following:
FILEDEF EMAILOP DISK \\xxxxx\cccc\hh\EMAILOP.TXT
and
APP FI EMAILOP DISK \\xxxxx\cccc\hh\EMAILOP.TXT

same results.
Nick


WebFOCUS 7.7.03 & 8.0.7
Windows
HTML, Excel, PDF, etc.
Also, using Maintain, etc.
 
Posts: 83 | Registered: February 26, 2009Report This Post
Expert
posted Hide Post
Have you run the FEX without Maintain in the picure ?

This could also be a permissions issue, if its a network share.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Nick

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, 2007Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
Of course you might get away with something like:
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, 2007Report This Post
Master
posted Hide Post
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, 2003Report 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     [SOLVED] MAINTAIN - TYPE ON DDNAME

Copyright © 1996-2020 Information Builders