Focal Point
MODIFY for retrieval only

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1721057422

April 23, 2007, 08:40 AM
Bruce C. Litzkow
MODIFY for retrieval only
Many years ago, IBI's advanced modify course materials had examples of code using MODIFY for retrieval only. Can anyone find this and send it to me or tell me where to find it online?
April 23, 2007, 09:58 AM
David Briars
Hi Bruce,

If you want to use the MODIFY command, but not to update a FOCUS db, you will want to be sure to use the USE command with the READ parameter. This will protect your db, from an inadvertent update.

Beyond this, one of the major ways to get output from a MODIFY command, besides INCLUDE, UPDATE, or DELETE, would be to use the 'TYPE ON ddname' command.

With 'TYPE ON ddname' you'd be creating a flat file, via the MODIFY command.

Is this the type (no pun intended) of thing you are looking to do?

Regards,
Dave




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
April 23, 2007, 02:01 PM
Jim_at_LM
Bruce:

From what I can recall, MODIFY for retrieval worked well with well designed FOCUS hierarchies or relations. The TYPE command can be used to outptut desired data into a sequential file.

With the MATCH key1. .. ON MATCH GOTO CASE1 - NEXT field ON NEXT FIELD IF D.field .. - or ON NEXT COMPUTE - worked nice to evaluate, retrieve and compute new values. Usually, conditions in a lower level segment could be evaluated in a NEXTing sequence to set summaries or switches to control other aggreagation/selection from other higher (or lower) level segments.

File inversion worked nice as well as long as the key field(s) were indexed (you could NEXT thru a lower level chain and make decisions on what to do with the higher level instances). I can recall a method where use of a COMBINE FILE structure to retrieve from one database while doing INCLUDEs to a single relation containing summary data worked well.

It depends on the application and what you are trying to solve. I have found that using pre-defined access paths with file inversions and multiple HOLD files using a combination of TABLEF and TABLE usually gets me the results I want. From there, I can summarize more, HOLD as a FOCUS file, do JOINs etc.
Jim


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
April 26, 2007, 01:57 PM
Kerry
Hi Bruce,

Has this issue been resolved? Thanks to David and Jim's input. Smiler

Please try the code:

COMBINE EMPDATA AND LOCATOR PREFIX L_ AS EMPLOC
MODIFY FILE EMPLOC                             
PROMPT PIN.ENTER A PIN NUMBER.                 
  COMPUTE L_PIN=PIN;                           
                                               
   PERFORM GETNAME                             
   PERFORM GETLOCATION                         
   PERFORM TYPEMEOUT 
                          
CASE GETNAME              
 MATCH PIN                
   ON NOMATCH REJECT      
    ON MATCH GOTO ENDCASE 
ENDCASE                   
                          
CASE GETLOCATION          
 MATCH L_PIN              
   ON NOMATCH REJECT      
    ON MATCH GOTO ENDCASE 
ENDCASE 
CASE TYPEMEOUT                            
TYPE                                      
"</2 EMPLOYEE ID: <D.PIN"                 
"           NAME: <D.FIRSTNAME  <D.LASTNAME " 
"        ADDRESS: <D.L_SITE"                  
"          FLOOR: <D.L_FLOOR </2"             
ENDCASE                            
                                          
DATA 


This is what the output would look like:
EMPLOYEE ID: 000000310
NAME: JEFF LIEBER
ADDRESS: 238 BEECHWOOD PLACE
FLOOR: 24

Hope this helps. Big Grin

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
April 27, 2007, 04:48 PM
Håkan
Bruce,

another alternative is using Maintain. Besides from being useful for prompting etc, there's so much you could do with Maintain that Modify can't.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
April 30, 2007, 11:53 AM
Bruce C. Litzkow
Thanks to all of you for your suggestions. I thought of the TYPE ON DDNAME. My friend ended up using COMBINE and it worked fine.