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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
KEY VALUE CHANGE
 Login/Join
 
Silver Member
posted
I need t replace a key value for all records in a Focus db (not in interactive mode)
In Focus I made it with SCAN command and
-REPEAT of DM
In WF 5.x this feature has been removed.
How can I do ?
I NEED THIS FEATURE TO SAFE TIME, MONEY and TO AVOID ERRORS (HOLD and LOAD)
Someone can help me ?
Thanks Paolo
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
Master
posted Hide Post
You could use Maintain to accomplish this. You would read in all the values. Make a copy of the stack and change the keyfield. Then include the new records and delete the old. The code would look like:

MAINTAIN FILE file
FOR ALL NEXT keyfield INTO STK
INFER keyfield INTO NEWSTK
STACK COPY FROM STK INTO NEWSTK
COMPUTE I/I4=1;
REPEAT NEWSTK.FOCCOUNT
COMPUTE NEWSTK(I).keyfield = 'NEW VALUE';
COMPUTE I=I+1;
ENDREPEAT
FOR ALL INCLUDE keyfield FROM NEWSTK
IF FOCERROR = 0 THEN
FOR ALL DELETE keyfield FROM STK
END
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
Thanks, but this works also if the key field is in the parent segment an the db has got other childs segment ?
I don't know if DELETE works right.
Thanks
Paolo
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
Master
posted Hide Post
It will work with parent / child relationships. You just need to add the child field to the NEXT, INCLUDE and DELETE statements. Using the CAR file, it would look like:

NEXT COUNTRY CAR INTO STK

INCLUDE COUNTRY CAR FROM NEWSTK

DELETE COUNTRY CAR FROM STK
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
Sorry but I get

(FOC03833) Internal Error detected in MASPAR :Inconsistent KEY information:
ERROR AT OR NEAR LINE 16 IN PROCEDURE TSTMAINT FOCEXEC *
(FOC03833) Internal Error detected in MASPAR :MATCH:

with the following statement

MAINTAIN FILE CAR
FOR ALL NEXT COUNTRY CAR INTO STK
INFER COUNTRY INTO NEWSTK
STACK COPY FROM STK INTO NEWSTK
COMPUTE I/I4=1;
REPEAT NEWSTK.FOCCOUNT
COMPUTE NEWSTK(I).COUNTRY='PIPPO';
TYPE NEWSTK(I).COUNTRY ;
COMPUTE I=I+1;
ENDREPEAT
FOR ALL INCLUDE COUNTRY CAR FROM NEWSTK
IF FOCERROR = 0 THEN
FOR ALL DELETE COUNTRY CAR FROM STK
END
END
-RUN

Where is the error ?
Paolo
PS I have never used maintain
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
Master
posted Hide Post
In your scenario, you would need to include the CAR field to NEWSTK. Try this...

MAINTAIN FILE CAR
FOR ALL NEXT COUNTRY CAR INTO STK
INFER COUNTRY CAR INTO NEWSTK
STACK COPY FROM STK INTO NEWSTK
COMPUTE I/I4=1;
REPEAT NEWSTK.FOCCOUNT
COMPUTE NEWSTK(I).COUNTRY='PIPPO';
TYPE NEWSTK(I).COUNTRY ;
COMPUTE I=I+1;
ENDREPEAT
FOR ALL INCLUDE COUNTRY CAR FROM NEWSTK
IF FOCERROR = 0 THEN
FOR ALL DELETE COUNTRY CAR FROM STK
END
-RUN
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
Sorry but I get the error
ex tstmaint
(FOC03833) Internal Error detected in MASPAR :Inconsistent KEY information:
ERROR AT OR NEAR LINE 16 IN PROCEDURE TSTMAINT FOCEXEC *
(FOC03833) Internal Error detected in MASPAR :MATCH:
with the following statement:
USE
/u/abp0/car.foc
END

MAINTAIN FILE CAR
FOR ALL NEXT COUNTRY CAR INTO STK
INFER COUNTRY CAR INTO NEWSTK
STACK COPY FROM STK INTO NEWSTK
COMPUTE I/I4=1;
REPEAT NEWSTK.FOCCOUNT
COMPUTE NEWSTK(I).COUNTRY='PIPPO';
TYPE NEWSTK(I).COUNTRY ;
COMPUTE I=I+1;
ENDREPEAT
FOR ALL INCLUDE COUNTRY CAR FROM NEWSTK
IF FOCERROR = 0 THEN
FOR ALL DELETE COUNTRY CAR FROM STK
END
-RUN
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
Master
posted Hide Post
I don't know why you are getting an error.
Try this. Before the INCLUDE and before the DELETE insert the line:
REPOSITION COUNTRY

If that doesn't help, comment out the DELETE and INCLUDE statements. See if you are actually retrieving the data from the CAR file. Make a back-up of the CAR.FOC file and just put the DELETE back in. See if the DELETE or the INCLUDE is causing the error.

What release and platform are you on?
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
>>ex tstmaint
DELETE commented:
(FOC03833) Internal Error detected in MASPAR :Inconsistent KEY information:
ERROR AT OR NEAR LINE 17 IN PROCEDURE TSTMAINT FOCEXEC *
(FOC03833) Internal Error detected in MASPAR :MATCH:

INCLUDE commented:
>>ex tstmaint
(FOC03833) Internal Error detected in MASPAR :Inconsistent KEY information:
ERROR AT OR NEAR LINE 20 IN PROCEDURE TSTMAINT FOCEXEC *
(FOC03833) Internal Error detected in MASPAR :MATCH:

Both commented:
>>ex tstmaint
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO
PIPPO

TRANSACTIONS: COMMITS = 1 ROLLBACKS = 0
SEGMENTS : INCLUDED = 0 UPDATED = 0 DELETED = 0
--------------------------------------
Release:
RELEASE = R720532B
GEN_NUM = 01.07
SOURCE_DATE = 09/29/2004 15:59:01
BUILD_DATE = 09/29/2004 22:51:19
INSTALLATION_DATE = 11/09/2004 13:31:23

ON AIX 4.3.3

Thanks
Paolo
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
Master
posted Hide Post
I am starting to think you cannot update that file. Let's try a very simple test. What does this yield:

MAINTAIN FILE CAR
COMPUTE COUNTRY = 'USA';
INCLUDE COUNTRY;
END

See if this includes USA as a country.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Expert
posted Hide Post
Not wishing to butt in Mark, but are we sure that Paolo's USE is functioning and not pointing to an empty or non-existant FOC file?

Paolo,

Try this first -

USE
/u/abp0/car.foc
END
TABLE FILE CAR
BY COUNTRY
END


If you get a report output then we know your USE is working, if not .... then fix that first.

Now try Mark's request and progress.

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, 2004Report This Post
Silver Member
posted Hide Post
We are going to migrate to a new IBM machine with AIX5.3 (new library, etc...)
I have installed wf5.3.2 on the machine and here
the same test on mantain procedure works fine
I don't know why.
However my problem has been resolved; thanks to all.
 
Posts: 36 | Location: Bologna Italy | Registered: March 11, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders