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 everyone, I'm pretty new to FOCUS, and having a few problems with it over the last few weeks. All the past problems I've had I could find an answer around here without posting. This time it was not the case, so I need some help from you guys.
The prolem is in this piece of code, I need to load the data from TEMPFILE, into SECURITY file, but it NEVER moves the data from the USERID field, which in my security file is the INDEX, and the main data I need on the file for further processing and reporting.
MATCH FILE TEMPFILE
PRINT USERID
FIRST_NAME_BF AS FIRST_NAME
LAST_NAME_BF AS LAST_NAME
LEVEL_BFOR AS LEVEL
BY USERID
RUN
FILE SECURITY
PRINT USERID
BY USERID
AFTER MATCH HOLD OLD-NOT-NEW
END
MODIFY FILE SECURITY
FIXFORM FROM HOLD
MATCH USERID
ON NOMATCH INCLUDE
END
Can someone tell me what I'm doing wrong? This piece of code is a copy of another program that does a similar function, and still this one's not moving the key field properly. The data on the file gets like this, inserting only the first record and then rejecting all others, saying that its a duplicate of the key
USERID FIRST_NAME LAST_NAME
------ ---------- ---------
ANDRE CASARINI
What I think even weird, is that it rejects the transactions saying that it has no userid, but shows me the userid in the transaction data: (FOC405) TRANS 1 REJECTED DUPL: ROOT CHKCASA ANDRE CASARINI
I really have no idea why this is happening. Any help will be highly appreciated, if you need any further info, please let me know.This message has been edited. Last edited by: andrekilik,
FOCUS 7.6 Mainframe, Outputs available
Posts: 15 | Location: Brasil | Registered: May 21, 2014
I am guessing that the USERID fields are exactly the same format?
What is the format of the SECURITY table?
This may not be exactly the same as your scenario but may help. Note that I am using SUM (my preference for this - should avoid duplicates in any event). Also I am not repeating the USERID into the output - you only need it once in each MATCH part. To stop the USERID being repeated in the second MATCH component, I am using another field but renaming it as NOTUSED, I then COMPUTE this within the MODIFY to prevent a FOC419 failure.
-* Preparation section
-* This is only to get something similar to your scenario
EX -LINES 6 EDAPUT MASTER, SECURITY, C, MEM, FILE=SECURITY, SUFFIX=FOC
SEGNAME=SEG01
FIELDNAME=USERID ,A10 ,A10 , FIELDTYPE=I, $
FIELDNAME=FIRST_NAME ,A10 ,A10 , $
FIELDNAME=LAST_NAME ,A15 ,A15 , $
FIELDNAME=LEVEL ,A04 ,A04 , $
-RUN
CREATE FILE SECURITY
-RUN
DEFINE FILE EMPDATA
USERID/A10 = EDIT(LASTNAME,'9999999$')||EDIT(FIRSTNAME,'9$');
END
TABLE FILE EMPDATA
SUM FIRSTNAME AS FIRST_NAME
LASTNAME AS LAST_NAME
DIV AS LEVEL
BY USERID
WHERE DIV EQ 'CORP'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS BASEDATA
END
-RUN
MODIFY FILE SECURITY
FIXFORM FROM BASEDATA
MATCH USERID
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA ON BASEDATA
END
-RUN
-* End of preparation section
MATCH FILE EMPDATA
SUM FIRSTNAME AS FIRST_NAME
LASTNAME AS LAST_NAME
DIV AS LEVEL
BY USERID
RUN
FILE SECURITY
SUM LEVEL AS NOTUSED
BY USERID
AFTER MATCH HOLD AS LOADDATA OLD-NOT-NEW
END
MODIFY FILE SECURITY
COMPUTE NOTUSED/A4 = '';
FIXFORM FROM LOADDATA
MATCH USERID
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA ON LOADDATA
END
-RUN
gives -
NUMBER OF RECORDS SELECTED= 41 LINES= 41
NUMBER OF RECORDS SELECTED= 8 LINES= 8
LINES OF MATCH OUTPUT = 33
TRANSACTIONS: TOTAL = 33 ACCEPTED= 33 REJECTED= 0
SEGMENTS: INPUT = 33 UPDATED = 0 DELETED = 0
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004