[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

442.0. "VMS Symbols included in Fex" by MASALA::SACAMPBELL (If at first you don't succeed, cheat!!) Tue Jul 30 1991 10:41

Hi,


Is it possible to include VMS symbols within a Focus routine to use like a focus
variable.


 And another thing (while my mind is ticking over)....

   How do you get a copy of an FTM file when using FOCUS/SUBDIR=DELETE. I have a 
Fex which produces a load of FTM's but only want one of those files to keep and 
get rid of the rest.

 I know you can do FOCUS/SUBDIR=VERIFY but the job will run in batch with nobody
to verify the deletion.


Any help appreciated,

	Stuart.
T.RTitleUserPersonal
Name
DateLines
442.1SymbolismGERBIL::BAMFORTHTue Jul 30 1991 13:1251
    
    I don't believe you can (directly) use VMS symbols in FOCUS.  If you
    have symbols you need to use in FOCUS, you can write these out to a 
    rms file prior to execing FOCUS.  Once in FOCUS, filedef this file then
    read your symbol values into Dialogue manager variables using the -READ 
    statement. 
    
    e.g. 
    
            last_update_date :== "06/18/91"
    
            open/write lud date.info 
                 write lud last_update_date  
            close lud 
    
             
            (enter FOCUS environment) 
    
            FILEDEF LASTDAT DISK DATE.INFO 
            -RUN 
            -READ LASTDAT &LASTDATE.A8. 
    
            TABLE FILE SOMEDATA 
            HEADING 
            "LAST UPDATE DATE : &LASTDATE" 
            " " 
            SUM THIS THAT AND COMPUTE THEOTHERTHING/P10 = THIS + THAT; 
            END   
    
    
    
    
     
    
    As for the use of SUBDIR=DELETE, you can salvage the one file you want
    saved by directing its creation to something other than the default 
    directory.  You do this by simply FILEDEFing the file to be produced. 
    
         FILEDEF ENDPROD DISK SYS$LOGIN:ENDPROD.DAT  
     
         TABLE FILE ...
         SUM ... 
         ON TABLE SAVE AS ENDPROD 
         END 
    
    
    
    
    Hope this is of some help.
    
    jb 
442.2Can't Get The FILEDEF Working MASALA::SACAMPBELLIf at first you don't succeed, cheat!!Wed Jul 31 1991 06:1138
jb

I tried the FILEDEF suggestion but still can't get a copy of the file out of
the temporary directory. I tested this on a simple Focus routine but still lost
the file.

Here is the simple fex I tried and the results received :

FILEDEF LOTENTY DISK SYS$LOGIN:AME5000.DAT   <-- This is the external file
FILEDEF TESTING DISK SYS$LOGIN:AMETEST.DAT   <-- This is what I want my temp 
DEFINE FILE LOTENTY                              file to be 
  QTTY/I4 = X_L_QTY_OUT + 0;
END

TABLE FILE LOTENTY
  SUM   QTTY
  BY X_ENTITY AS '   ENTITY   '
  IF X_FACILITY EQ 'SQFAB1'
  IF X_ENTITY EQ '5000.1' OR '5000.2'
  IF X_EVENT EQ 'STOP PROD'
  ON TABLE HOLD AS TESTING
END

>>>>
 NUMBER OF RECORDS IN TABLE=      9  LINES=      2

 HOLDING...


>>vms dir sys$login:ametest.dat

%DIRECT-W-NOFILES, no files found


When I FIN from Focus the temporary file TESTING.FTM is deleted.


		Stuart.
442.3Try this... (???)NQOAIC::BEAUCHESNEWed Jul 31 1991 12:3313
    	RE -1
    
    	I think the reason you can't see the .DAT file, is that it is
    really a .FTM file.  In reply .1, the author uses ON TABLE SAVE, rather
    than ON TABLE HOLD.  It may be that this is why the FILEDEF is not working.
    
    	If that's not the case, then you may want to use a VMS RENAME
    command in the FEX after the hold file is created.
    
    	Let us know how you make out!
    
    	Moe
    
442.4 PAKORA::SACAMPBELLIf at first you don&#039;t succeed, cheat!!Wed Jul 31 1991 12:5616

   Changed the ON TABLE HOLD to ON TABLE SAVE and got my file in SYS$LOGIN.

  Is there any advantage/disadvantage of using one rather than the other.

  Would you recommend one rather than the other in certain situations.

  All the Focus routines we have running here use ON TABLE HOLD 'cause that's
what the guy taking the course taught us.



	Thanx for your help,

		Stuart. 
442.5HOLD vs. SAVE differencesNQOAIC::BEAUCHESNEWed Jul 31 1991 15:067
    	The two differences I can see is that 1) a HOLD file will create a
    Master File Description while a SAVE file will not; and 2) a HOLD file has
    more FORMAT options than a SAVE file.  
    
    Perhaps someone with more FOCUS experience can add to this.  
    
    Moe
442.6HOLD-THE-PHONEGERBIL::BAMFORTHWed Jul 31 1991 16:33106
    
    I have a solution to the HOLD problem when creating files in the
    SUBDIR=DELETE mode.  First, FOCUS (V6.0 or better) by default, directs
    files according to the setting of the FOCEXTRACT variable.  The settings
    are as follows. 
    
                    SET FOCEXTRACT = TEMPORARY   (create files in the
                                                  temporary subdir)
                                                  this is the default setting
                   
    
    OR 
    
                    SET FOCEXTRACT = DEFAULT     (create files in your
                                                  default directory) 
    
    
    
    
    Now, the problem is how does one take advantage of the temp file
    clean-up capabilities of the SUBDIR=DELETE option, but yet retain 
    a hold file resulting from a series of steps. 
    
    
    The solution takes advantage of a V6.0 improvement that allows one to
    change a SET variable only for a single TABLE request, rather than 
    for the duration of the FOCUS session. 
    
    a crude example... 
    
    FOCUS/SUBDIR=DELETE  
    
           TABLE FILE INFILE1 
             SUM A B C 
             BY D 
           ON TABLE HOLD 
           END 
           -RUN 
    
           JOIN A IN HOLD TO A IN OTHRFILE AS J1 
     
           TABLE FILE HOLD 
             SUM A B C OTHRFLD 
             BY D 
           ON TABLE HOLD AS RPTFILE 
           END 
           -RUN 
    
           TABLE FILE RPTFILE 
           HEADING 
           "A SAMPLE REPORT YOU WANT TO RETAIN" 
           " "
           SUM A B OVER C D OTHRFLD
    --->   ON TABLE SET LINES 60, FOCEXTRACT DEFAULT 
           ON TABLE HOLD AS REPORT FORMAT DOC  
           END 
           -EXIT
    
    
    In the above example, the default setting of FOCEXTRACT
    (FOCEXTRACT=TEMPORARY) is in effect except for the very last TABLE,
    where we've changed to value to DEFAULT.  Which means FOCUS will delete
    all files it creates except the one created when the value of
    FOCEXTRACT was DEFAULT, which will be placed in your default
    (non-temporary) directory. 
    
    
    assuming the above is EXAMPLE.FEX, we will be able to do this...
    
    
    $ set def sys$login 
    $ FOCUS/SUBDIR=DELETE 
      EX EXAMPLE 
      FIN 
    $ DIR/FULL REPORT.DOC 
    $ EXIT
    
    
    
    As for HOLD vs. SAVE, HOLD is used in 99% of cases.  It has many
    advantages over SAVE. 
    
         (1) creates a Master describing the .FTM file created.  
    
         (2) compresses data (when using the ON TABLE HOLD option in the 
             (default) binary mode). 
    
         (3) If you are creating input to a MODIFY, the MODIFY can read 
             a HOLD file without you having to explicitly describe the 
             input record via FIXFORM.  
    
         (4) You can, with V6.0 upward, create a FOCUS file from a TABLE 
             request, etc., etc. 
    
             e.g.       MODIFY FILE NUTCAKE
                        FIXFORM FROM HOLD 
                        MATCH ... 
                              ... 
                              ... 
                        DATA ON HOLD
                        END 
    
                         
    
    
    joe