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] USE Statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] USE Statement
 Login/Join
 
Gold member
posted
I had a tough time finding any good documentation on this, so I'm deciding to post my question instead. I apologize if this has already been answered by a previous posting.

I have a FOCUS file that gets loaded with month-to-date trade data everyday. The file grew by 6% in size overnight, so I wanted to take a look at what was different between the load from 2 days ago and last night's build. I'm using a USE statement to concatenate the two files together, however, I need to DEFINE a variable in order to determine which file each record came from.

USE
\\server\folder\FILE01.FOC AS FILE01
\\server\folder2\FILE01.FOC AS FILE01
END
DEFINE
FILE FILE01
SRC/A4=IF folder THEN 'PREV'
ELSE IF folder2 THEN 'CURR';
END

The DEFINE above is psuedo-code. I need some help filling in the actual code that I can use in each IF condition. Is there a system variable like &FOCFOCEXEC available or something that would tell me which path the record was sourced from. The FOC files have the same names, so I can't differentiate them by name. I also am aware that I can do this with separate hold files, but I'm hoping to learn a new...and useful...technique. Thanks in advance for your time.

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


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Expert
posted Hide Post
The USE concatenates the two files - there will be no way to identify records from each file. you could identify records based on some other field - e.g. a Date field.

Instead of using the USE command to concatenate the two files, try using the MORE command, something like this:

USE
\\server\folder\FILE01.FOC AS FILE01
END
-RUN

DEFINE FILE FILE01
SRC/A4 = 'PREV';
END
-RUN

TABLE FILE FILE01
PRINT
*
SRC
ON TABLE HOLD AS HPREV
END
-RUN

USE
\\server\folder2\FILE01.FOC AS FILE01
END
-RUN

DEFINE FILE FILE01
SRC/A4 = 'CURR';
END
-RUN

TABLE FILE FILE01
PRINT
*
SRC
ON TABLE HOLD AS HCURR
END
-RUN

TABLE FILE HPREV
PRINT *
ON TABLE HOLD AS HALL
MORE
FILE HCURR
END
-RUN

If you have individual masters for the two files, you don't have to create the intermediary HOLD files.


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
Gold member
posted Hide Post
Thanks Francis. I was hoping their was something accessible in the internal matrix or something that could differenctiate the two files even after they were concatenated. I had already looked for a run date-type field that I could use, but unfortunately, we didn't design the file to include a field such as that. I'll stick with the temporary hold file methods.


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
<JG>
posted
Do it the correct way and add an extra column to the FOCUS tables.

i.e. SOURCE/Awhatever
 
Report 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] USE Statement

Copyright © 1996-2020 Information Builders