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
Maintain SOS
 Login/Join
 
Member
posted
The following MAINTAIN code does not delete the data in the focus file based on the stack. I verified that the delete stack was loaded with three rows. The FOCERROR is getting set to 1 . Help!!

INFER PNDAGENV.PNDAGENV.TG_DOCNO INTO STK_AUTH_EDIT;
Reposition PNDAGENV.PNDAGENV.TG_DOCNO;
Stack clear STK_AUTH_EDIT ;
For all next PNDAGENV.PNDAGENV.TG_DOCNO into STK_AUTH_EDIT WHERE TG_OBLTBLSEG EQ "FINANCE";

INFER PNDAGENV.PNDAGENV.TG_DOCNO INTO STK_AUTH_DELETE;
STACK CLEAR STK_AUTH_DELETE;
Stack copy from STK_AUTH_EDIT into STK_AUTH_DELETE Where (TG_SOURCE EQ "E");


-*WINFORM SHOW Form1;

COMPUTE STK_AUTH_DELETE.FocIndex = 1;
REPOSITION PNDAGENV.PNDAGENV.TG_DOCNO;
FOR ALL Delete pndagenv.PNDAGENV.TG_DOCNO from STK_AUTH_DELETE ;
COMPUTE MESSAGE=FOCERROR
COMMIT;


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
Virtuoso
posted Hide Post
On the basis of the code here there should be no problems, but I assume this is a snippet.

Firstly the first INFER is not required, the 'for all next' will create the stack, and the COMPUTE STK_AUTH_DELETE.FocIndex = 1; does nothing.

However that won't help you.

The only thing I can think of is that somewhere, outside the code snippet, you may be adding to STK_AUTH_DELETE.FocCount.

Just prior to the DELETE, verify the key field values in STK_AUTH_DELETE, by typing them out. FocError of 1 is pretty specific that it cannot find a record to delete.

Are you using FDS?
Is the segment an S1 or SH1?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Thanks Alan.

I stripped the code down to the minimum and removed the unecessary instructions per your message. Now it looks like this:

MAINTAIN FILE PNDAGENV

$$Declarations

Case Top

For all next PNDAGENV.PNDAGENV.TG_DOCNO into STK_AUTH_EDIT WHERE TG_OBLTBLSEG EQ "FINANCE";

INFER PNDAGENV.PNDAGENV.TG_DOCNO INTO STK_AUTH_DELETE;
Stack copy from STK_AUTH_EDIT into STK_AUTH_DELETE Where (TG_SOURCE EQ "E");


REPOSITION PNDAGENV.PNDAGENV.TG_DOCNO;

REPEAT STK_AUTH_DELETE.FOCCOUNT ROW/I4=1;
SAY "STK_AUTH_DELETE.TG_DOCNO IS " STK_AUTH_DELETE(ROW).TG_DOCNO ".
"
ENDREPEAT ROW=ROW+1;

FOR ALL Delete pndagenv.PNDAGENV.TG_DOCNO from STK_AUTH_DELETE ;
SAY "FOCERROR IS " FOCERROR
COMMIT;

EndCase

END

The results are as follows (Note the last "SAY")

STK_AUTH_DELETE.TG_DOCNO IS H2.
STK_AUTH_DELETE.TG_DOCNO IS O03.
STK_
AUTH_DELETE.TG_DOCNO IS O43433.
FOCERROR IS 1
TRANSACTIONS: COMMITS = 2 ROLLBACKS = 0
SEGMENTS : INCLUDED = 0 UPDATED = 0 DELETED = 0

No data is deleted. Curious. Thanks for any suggestions ..


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
Member
posted Hide Post
I forgot to give you the MFD snippit:

FILE=PNDAGENV ,SUFFIX=FOC , $
SEGNAME=PNDAGENV , SEGTYPE=S1,$
FIELDNAME=TG_DOCNO ,TG_DOCNO ,A9 ,A9 ,$
FIELDNAME=TG_SUBCERTID ,TG_SUBCERTID ,A8 ,A8 ,$
FIELDNAME=TG_SUBMITORG ,TG_SUBMITORG ,A8 ,A8 ,$


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
Master
posted Hide Post
Please change the SAY line to:

TYPE "Record <
This will show the rows and the values. If you do multiple rows in a DELETE and the last one fails, that would explain for FOCERROR =1. The other thing you COULD do is place the delete inside the loop:


REPEAT STK_AUTH_DELETE.FOCCOUNT ROW/I4=1;
TYPE "Record <Delete pndagenv.PNDAGENV.TG_DOCNO from STK_AUTH_DELETE(Row) ;
ENDREPEAT ROW=ROW+1;
TYPE "FOCERROR IS <
Let us know.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Here is the new code:

MAINTAIN FILE PNDAGENV
$$Declarations
Case Top
For all next PNDAGENV.PNDAGENV.TG_DOCNO into STK_AUTH_EDIT WHERE TG_OBLTBLSEG EQ "FINANCE";
INFER PNDAGENV.PNDAGENV.TG_DOCNO INTO STK_AUTH_DELETE;
Stack copy from STK_AUTH_EDIT into STK_AUTH_DELETE Where (TG_SOURCE EQ "E");
REPOSITION PNDAGENV.PNDAGENV.TG_DOCNO;
REPEAT STK_AUTH_DELETE.FOCCOUNT ROW/I4=1;
TYPE "TG_DOCNO: ENDREPEAT ROW=ROW+1;
FOR ALL Delete pndagenv.PNDAGENV.TG_DOCNO from STK_AUTH_DELETE ;
SAY "FOCERROR IS " FOCERROR
COMMIT;
EndCase
END

Here are the new results:
TG_DOCNO: H2
TG_DOCNO: O03
TG_DOCNO: O43433
FOCERROR IS 1
TRANSACTIONS: COMMITS = 2 ROLLBACKS = 0
SEGMENTS : INCLUDED = 0 UPDATED = 0 DELETED = 0

Also I had tried to put the delete inside the loop yesterday and that didn't work either. I am truly puzzled. .. joe


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
Master
posted Hide Post
Alright.

That is odd. Let's try this. Read in just one record and delete it. Instead of copying the data to a second stack, just use both conditions on loading the one stack.

MAINTAIN FILE PNDAGENV
$$Declarations
Case Top
Next PNDAGENV.PNDAGENV.TG_DOCNO into STK_AUTH_EDIT
WHERE TG_OBLTBLSEG EQ "FINANCE"
AND TG_SOURCE EQ "E"
Delete pndagenv.PNDAGENV.TG_DOCNO from STK_AUTH_EDIT ;
SAY "FOCERROR IS " FOCERROR
COMMIT;
EndCase
END

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
joe,

You might try querying the state of 'focurrent' as well as 'focerror' after the delete attempt. if it isn't '0' you may have a SU/FDS problem.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Member
posted Hide Post
Mark's code produced the following:

FOCERROR IS 0
TRANSACTIONS: COMMITS = 2 ROLLBACKS = 0
SEGMENTS : INCLUDED = 0 UPDATED = 0 DELETED = 1


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
Virtuoso
posted Hide Post
Now that is weird.

Why does Mark's code produce 1 record, but the original code gave 3 records.

The code looks fine and in a repro works as expected.

This almost points to it being a data issue. Could the datafile be corrupt somehow? Have you tried a REBUILD?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Actually my code only deleted one record because we only loaded one record. I used a NEXT instead of a FOR ALL NEXT. However, as Alan points out, that could mean that the second or third record has a problem in the database.

At this point you can REBUILD REBUILD the database or just run my code 2 more times and see if it succeeds both times. We can add back in the STACK COPY. Let us know how you want to procede.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
It looks like the rebuild worked!!! Thanks for the help!! The data is now being deleted from the file based on the stack values with a "for all delete" statement ... joe


Configuration Date: 10/31/2007
Build Date: 09/15/2007
Gen Number: 231
Release: 763
Source Date: 09/14/2007
WF jar seq number: 71
WF jar release: 7.6.3
Build Sys: Linux Kernel-2.6.5-glibc-2.3.3 zSeries 64bit
Support Sys: Linux Kernel-2.6.5-glibc-2.3.3 and up zSeries 64bit
 
Posts: 9 | Registered: December 30, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders