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] Dynamic MFD Creation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Dynamic MFD Creation
 Login/Join
 
Platinum Member
posted
I am attempting to create my mfd's on the fly for csv files. I've done this a zillion times in a Windows environment, I've done it on Linux, now I'm attempting it on HP UX. Although, this is my first attempt for a csv file. I keep getting errors on the '$' at the end of each row. I've tried using edaput to creat the mfd, and I've tried -write to create the mfd, they both result in the same error. I've searcched FocalPoint but didn't find anything that fit my situation. Below is my code using edaput, and my code using the -write, any help is greatly appreciated.
 

EX -LINES 8 EDAPUT MASTER,&FILENM1,CV,FILE
FILE=&FILENM1, SUFFIX=COMT, DATASET='/webfocus/&FILENM1&CSV'
SEGNAME=&FILENM1, SEGTYPE=S0, $
  FIELD=FAC_NAME       , ALIAS=FAC_NAME       , USAGE=A50 , ACTUAL=A50 , $
  FIELD=FAC_NBR        , ALIAS=FAC_NBR        , USAGE=A7  , ACTUAL=A7  , $
  FIELD=DOLLAR_VOLUME  , ALIAS=DOLLAR_VOLUME  , USAGE=P8.2, ACTUAL=P8.2, $
  FIELD=TROP_PURE_PREM , ALIAS=TROP_PURE_PREM , USAGE=P19 , ACTUAL=P19 , $
  FIELD=TROP_SHLF_STBL , ALIAS=TROP_SHLF_STBL , USAGE=P19 , ACTUAL=P19 , $
  FIELD=NAKED_JUICE    , ALIAS=NAKED_JUICE    , USAGE=P19 , ACTUAL=P19 , $
END
-RUN


APP FI CLEAR &FDEF
-RUN
APP FI &FILENM1 DISK /webfocus/&FILENM1&CSV
APP FI &FILENM1 DISK &FDEF
-RUN
-WRITE &FILENM1.EVAL FILENAME=&FILENM1.EVAL, SUFFIX=COMT, DATASET='/webfocus/&FILENM1&CSV'
-WRITE &FILENM1.EVAL SEGNAME=SEG01, SEGTYPE=S01
-WRITE &FILENM1.EVAL FIELD=FAC_NAME       ,FAC_NAME, A50,A50,$
-WRITE &FILENM1.EVAL FIELD=FAC_NBR        ,FAC_NBR, A7,A7,$
-WRITE &FILENM1.EVAL FIELD=DOLLAR_VOLUME  ,DOLLAR_VOLUME,A8,A8,$
-WRITE &FILENM1.EVAL FIELD=TROP_PURE_PREM ,TROP_PURE_PREM, A19,A19,$
-WRITE &FILENM1.EVAL FIELD=TROP_SHLF_STBL ,TROP_SHLF_STBL,A19,A19,$
-WRITE &FILENM1.EVAL FIELD=NAKED_JUICE    ,NAKED_JUICE,A19,A19,$
END
-RUN
UNIX chmod 777 eit200801.mas
-RUN
 

This message has been edited. Last edited by: Kerry,


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Guru
posted Hide Post
linus,

Sounds like DM doesn't like the $. Try this:

-SET &DOLLAR='$';
-WRITE &FILENM1.EVAL FIELD=FAC_NAME       ,FAC_NAME, A50,A50,&DOLLAR.EVAL


Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Expert
posted Hide Post
Very good Fernando, that's probably it.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
quote:
UNIX chmod 777 eit200801.mas

Linus,

What error are you getting? For the command above, you are going to have to put the fully-qualified name of the master as your default directory is in EDATEMP whereas you are putting the master is a more permanent location.

Also make sure that you have permissions to write to the directory where you are putting the master (which should be in the ibi/apps directory structure).


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
quote:
Reply



IB - Developer Center Forums FOCUS/WebFOCUS Dynamic MFD Creation

The error I'm getting is:
(FOC229) ERROR READING EXTERNAL DATA FILE: EIT200801
Symbol '$' outside of text field is illegal : line 1

I get this error for every line in my mfd that contains a '$'.

I tried setting an &var to '$', but this didn't resolve the issue either.

I'm placing my mfd in edatemp. I was getting this error prior to adding the code to give the file full permissions. I added the chmod code to see if this had any impact -- it didn't.

I want to have dynamic mfd's because I don't want to have to try to remember come every April that I need to change my mfd names to reflect the current year.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Master
posted Hide Post
Rather than going through all of this, why don't you create one master and either FILEDEF EIT DISK /path/&FILENAME&CSV or USE &FILENAME AS EIT?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
That's what I ended up doing.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Master
posted Hide Post
quote:
-SET &DOLLAR='$';
-WRITE &FILENM1.EVAL FIELD=FAC_NAME ,FAC_NAME, A50,A50,&DOLLAR.EVAL


You should have &DOLLAR with no .EVAL for it to treat the code as a variable containing dollar rather than a literal.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Expert
posted Hide Post
linus, the syntax for EDAPUT can be a little tricky.

Try changing the -LINES 8 to -LINES 9

EX -LINES 9 EDAPUT MASTER,&FILENM1,CV,FILE
FILE=&FILENM1, SUFFIX=COMT, DATASET='/webfocus/&FILENM1&CSV'
SEGNAME=&FILENM1, SEGTYPE=S0, $
  FIELD=FAC_NAME       , ALIAS=FAC_NAME       , USAGE=A50 , ACTUAL=A50 , $
  FIELD=FAC_NBR        , ALIAS=FAC_NBR        , USAGE=A7  , ACTUAL=A7  , $
  FIELD=DOLLAR_VOLUME  , ALIAS=DOLLAR_VOLUME  , USAGE=P8.2, ACTUAL=P8.2, $
  FIELD=TROP_PURE_PREM , ALIAS=TROP_PURE_PREM , USAGE=P19 , ACTUAL=P19 , $
  FIELD=TROP_SHLF_STBL , ALIAS=TROP_SHLF_STBL , USAGE=P19 , ACTUAL=P19 , $
  FIELD=NAKED_JUICE    , ALIAS=NAKED_JUICE    , USAGE=P19 , ACTUAL=P19 , $


The number of lines includes the EDAPUT line, and you don't need the END.


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
Platinum Member
posted Hide Post
I tried -lines 9, that's actually what I started out with. I removed the code and went with one mfd and a filedef for each qtr referencing the one mfd. This is working great. I would like to know why I couldn't get the code to work though, does it have to do with my file being a .csv, or is the syntax different between linux and unix? This syntax worked in a linux environment.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Expert
posted Hide Post
linus, I copied your code to our WF server on our SUN box and ran it, is write the master file out.

We have done this type of thing here quite offen, and had no problems.

What does your code look like and also the content of the csv file.

Also, What do you set the Amer variables to ?


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
Platinum Member
posted Hide Post
You may have a NewLine issue ... (lines end in CR/LF or LF/CR ...)
The -LINES n parm includes what ever comes after ,FILE,
In your case I suggest you go to -10 and make sure there is a blank line after the Naked_Juice line (I will refrain from asking whats in that field)


Brian Suter
VP WebFOCUS Product Development
 
Posts: 200 | Location: NYC | Registered: January 02, 2007Report This Post
Expert
posted Hide Post
Brian, as far as I am aware EX -LINES n EDAPUT will ignore blank lines.

I would suggest $, it will give an error in FOCUS, but good enough to test with


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
Platinum Member
posted Hide Post
I had tried 10 for the line count. I reverted to a different approach and moved on. Thanks for the responses. "Naked Juice" is a brand of fruit juice.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Virtuoso
posted Hide Post
quote:
EX -LINES n EDAPUT will ignore blank lines.


Came across this, and felt it deserves clarification.

It's not that EX -LINES ignores any blank lines -- it never receives them. The Dialog Manager scan of the fex (the process that stacks the Focus command lines) is programmed to suppress blank lines, on the assumption that they have no effect on execution (that's the extent of the scan's knowledge of FOCUS language syntax).

EX -LINES is a focus command, so it only get executed in Focstack. And only the non-blank lines make it to Focstack.

If you ever do need to stack a blank line, include a &var whose value is blank, so that the line is non-blank before substitution, but blank after substitution. That will fool the DM scan into considering the line significant.

For instance, to feed a blank transaction line to Modify:
-SET &nada=' ';
MODIFY ...
FIXFORM ...
. . .
DATA
   &nada
END


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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] Dynamic MFD Creation

Copyright © 1996-2020 Information Builders