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] Logging Deleted Transaction in MODIFY

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Logging Deleted Transaction in MODIFY
 Login/Join
 
Member
posted
I have written the below focus mainframe code wherein i am deleting transactions from the focus database using MODIFY feature. I want to log all the deleted transaction. The LOG ACCEPT only only the accepted transaction i.e. 4 in below case. If we see the output of the below code, it shows that there are 649 lines deleted. Can i log all those 649 line deleted in some PS file using some command



MODIFY FILE R5482M01.BASE.POL.NUM
CHECK 99999
LOG NOMATCH ON NMACH
LOG DUPL ON DUPL
LOG ACCEPT ON ACCPT
FIXFORM BASE.POL.NUM/7 PLN.CH.EF.DY/8 PL.LST.CH.DY/8
MATCH BASE.POL.NUM
ON MATCH CONTINUE
ON NOMATCH REJECT
MATCH PLN.CH.EF.DY PL.LST.CH.DY
ON MATCH DELETE
DATA ON TSSTDEL
END




Output of the above in spool is


TRANSACTIONS: TOTAL = 4 ACCEPTED= 4 REJECTED= 0
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 649

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


FOCUS version 7.6.7.
Windows
Excel
 
Posts: 14 | Registered: June 10, 2009Report This Post
Virtuoso
posted Hide Post
Unfortunately, since a single transaction deletes dozens or hundreds of records in this case, the logging of transactions will not produce a list of all deleted records. You might be able to accomplish this with the use of NEXT and CASE logic, but the MODIFY code becomes complicated.

The easiest approach may be to generate a list of records that meet the delete criteria before-hand. How is file TSSTDEL created? Is it the result of a TABLE FILE? If so, you could print a report of all records that meet the delete criteria before running the MODIFY and then verify that the number of lines (&LINES) from the report matches the number of deleted segments (&DELTD) from the MODIFY.

EDIT: Sorry, but I mistakenly said that &LINES should equal &DELTD. &DELTD will exceed &LINES because &LINES will equal the number of report records, while &DELTD will equal the number of deleted segments - in this case one record consists of many segments.

Otherwise, CASE/NEXT logic might look something like this. Mixing MATCH and NEXT logic can be dangerous so proceed with caution. This example arbitrarily assumes two key levels below PL.LST.CH.DY (keyname4 and keyname5) - keyname5 being the last key in the table hierarchy.

MODIFY FILE R5482M01.BASE.POL.NUM 
 FIXFORM BASE.POL.NUM/7 PLN.CH.EF.DY/8 PL.LST.CH.DY/8 
 GOTO KEYMATCH

 CASE KEYMATCH
  MATCH BASE.POL.NUM PLN.CH.EF.DY PL.LST.CH.DY 
   ON MATCH GOTO KEYNEXT
   ON NOMATCH REJECT
   ON NOMATCH GOTO TOP
 ENDCASE

 CASE KEYNEXT
  NEXT <keyname4>
   ON NEXT GOTO LOGDELS
   ON NONEXT GOTO DELRECS
 ENDCASE

 CASE LOGDELS
  NEXT <keyname5>
   ON NEXT TYPE ON DELTRANS
    "will be deleted: <BASE.POL.NUM <PLN.CH.EF.DY <PL.LST.CH.DY <keyname4 <keyname5 "
   ON NEXT GOTO LOGDELS
   ON NONEXT GOTO KEYREMATCH
 ENDCASE

 CASE KEYREMATCH
  ACTIVATE RETAIN BASE.POL.NUM PLN.CH.EF.DY PL.LST.CH.DY <keyname4>
  MATCH BASE.POL.NUM PLN.CH.EF.DY PL.LST.CH.DY <keyname4>
   ON MATCH GOTO KEYNEXT
   ON NOMATCH TYPE
    "NOMATCH error in CASE KEYREMATCH: This should NEVER happen!!!"
   ON NOMATCH GOTO EXIT
 ENDCASE

 CASE DELRECS
  ACTIVATE RETAIN BASE.POL.NUM PLN.CH.EF.DY PL.LST.CH.DY
  MATCH BASE.POL.NUM PLN.CH.EF.DY PL.LST.CH.DY 
   ON MATCH TYPE ON DELTRANS
    "deleted: <BASE.POL.NUM <PLN.CH.EF.DY <PL.LST.CH.DY "
   ON MATCH DELETE
   ON MATCH GOTO TOP
   ON NOMATCH TYPE
    "NOMATCH error in CASE DELRECS: This should NEVER happen!!!"
   ON NOMATCH GOTO EXIT
 ENDCASE

 CASE AT START
  CHECK 99999 
  LOG NOMATCH ON NMACH 
  LOG DUPL ON DUPL 
  LOG ACCEPT ON ACCPT
 ENDCASE

 DATA ON TSSTDEL 
END 

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
Allocate a file to write transactions to. Exp: DELTRANS

After match of transaction to be deleted:

ON MATCH TYPE ON DELTRANS
“d.field d.field d.field”

Where d. are data values from the database

Next command ON MATCH DELETE


Mainframe FOCUS 7.6.7
all output
 
Posts: 1 | Registered: September 17, 2009Report This Post
Platinum Member
posted Hide Post
I think Dan make good point of many segment database.

If you have many segment and not the one then use Dan's suggested and not rely on single MATCH like Doren suggest.

If only single segmented then ON MATCH DELETE be OK.

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Virtuoso
posted Hide Post
I just discovered an error in the MODIFY code I posted earlier. In CASE DELRECS I had specified "ON MATCH/NOMATCH GOTO EXIT", but in the case of ON MATCH, the logic should GOTO TOP. I have corrected my earlier post.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Virtuoso
posted Hide Post
Of course, you could also do a TABLE first, selecting all the records that are going to be deleted (using the same transaction file as you'll be using in the modify), hold it to a file that you can archive, and then do the modify.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report 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] Logging Deleted Transaction in MODIFY

Copyright © 1996-2020 Information Builders