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 Prarie thank you for your response, I don't have a FOCUS Console where I can do table FILE, I'm running my FOCUS program under Z/OS. Is there another way to find the error?
Basically your MATCH FILE logic looks OK. But I'm confused as to where the DEFINE fits too.
Also, It might be useful if you tried to reduce the number of variables in order to isolate the problem. I would change the name of your PRT field - it's possibly part of some reserved word - maybe undocumented, to something like PRTABCD.
Then, I don't see why you have the NOPRINT for the field LICTA. You will be doing a subsequent TABLE request against your hold file so having an additional column in it does no harm. Finally I would change your AFTER MATCH statement to say HOLD AS FLHOLDBD OLD-AND-NEW and then do as Prarie suggests to see if the newly-named 'PRTABCD' field shows up. I know that's not the final result you want, but it will indicate if PRTABCD occurs in any records that overlap with LICTA.
In addition you can SET &ECHO=ALL ahead of your MATCH FILE and the subsequent TABLE request and it should show how many records were selected at each stage of the MATCH FILE process.
PS - What do you mean you can't do a TABLE FILE request? Just slot Prarie's code right in after the MATCH FILE sequence.
The JOIN is more efficient as long as the TO file has a common field that is INDEXED. The MATCH FILE logic is invaluable where the common fields are not indexed. Because MATCH FILE requires each original data source to be sorted by the same field it means the relevant records from each data set can be matched up. Note that when using MATCH FILE you can insert a WHERE clause for each data set processed just as you would with a TABLE request in order to limit the number of records selected.
MATCH FILE FILE001
PRINT PRT
BY LICTA NOPRINT
RUN
FILE FILE002
PRINT NTA
ADDFIELD
BY LICTA NOPRINT
AFTER MATCH HOLD AS FLHOLDBD OLD
END
JOIN ADDFIELD IN FLHOLDBD TO
ADDFIELD2 IN ANTFILE AS J6
Yes, I made a mistake my join has to be from ANTFILE to FLHOLDBD. The common field between the two fields would be ADDFIELD (FLHOLDBD) and ADDFIELD2(ANTFILE)
Although I could sort out the problem I got a question. What if ANTFILE and FLHOLDBD didn't have a common field, how do I use the field PRT? Can I declare global variables in FOCUS as in other languages?
I want to store PRT in a temporary variable, so it can be used in other part of my code. Just one question, this temporary variable has to be declared with an ampersand? I ask that because on my program I've seen some variables which start with & but they all come from the JCL that executes the program.
if you want to store it in a temporary field you should to this
suppose the field PRT is A8 lenght
SET HOLDLIST=PRINTONLY
TABLE FILE XXX
PRINT PRT
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD &TEMPVAR1.A8
-TYPE &TEMPVAR1
TABLE FILE CAR
PRINT MODEL
BY COUNTRY
HEADING
"this is the tempfield &TEMPVAR "
END
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Thank you Frank, but what if I wanted to store more variable not just one for example:
TABLE FILE XXX
PRINT PRT
COR
CRD
ON TABLE HOLD FORMAT ALPHA
END
How do I store the values of PRT,CORD and CRD in 3 different variables? Or what if I just wanted to store CRD variable and not the others?This message has been edited. Last edited by: bohorkez,
As only you know what COR and CRD means and what their sizes are I am using A8 as an example but you'll have to adjust accordingly.
More detailed information with samples and all can be found in the Developing Reporting Applications manual under:
Managing flow of Control in an Application > Customizing a Procedure with Variables > Reading Variable Values From and Writing Variable Values to an External File
That, and other guides are available with your local installation of Developer Studio or can be accessed/downloaded from IBI's tech support site.
You can't pick and choose at that level of detail.
If you TABLE FILE PRINT 3 columns, then the resulting ALPHA file will contain a string of values with those 3 fields.
If you only need to extract field 2 fron the text file under a certain condition you can:
-READ HOLD &DUMMY1.A8. &CRD.A8. &DUMMY2.A8
and then just do nothing with &DUMMY1 and &DUMMY2. They are just variables so you don't have to use them.
That, of you can get fancy and make your TABLE FILE PRINT statement more "dynamic" via Dialogue Manager to add only the fields you need, but then you'll have to have various versions of -READ (with 1, 2 and all variables) and -GOTO to each depending on your needs. Too unnecessarily complicated in my opinion.
If you were using WF 7.7 you could take advantage of the new -READFILE command but it is unfortunately not available in 7.6.
Just go with the &DUMM1n approach and you should be fine.
Thank you I understood, going to try your idea. However I believed that I could reuse a field of a HOLD FILE without declaring extra temporary variables.