dbTalk Databases Forums  

FOF not being updated by FILE-SAVE or SAVE

comp.databases.pick comp.databases.pick


Discuss FOF not being updated by FILE-SAVE or SAVE in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Neil Charrington
 
Posts: n/a

Default FOF not being updated by FILE-SAVE or SAVE - 11-21-2005 , 10:58 AM






I have tried on numerous occasions to create the FOF for the whole system
but no matter what I try the file numbers for all NEW files that were not in
the original downloaded D3 system (i.e. DM, SQLDEMO etc.) show with a
minus sign "next" to them and they do not appear in the FOF. I have tried
FILE-SAVE, SAVE (s,f,d,g and SAVE (s,f,d,g,t.

Can anyone suggest what I am doing wrong or why this would happen?

The system I am working with is D3 7.4.5 on Win2K3 Server and all of the
accounts/files in question are FSI's.

Thanks.

Neil.

Neil Charrington
S C Systems
T: +44 1564 777011
F: +44 1564 777454
W: www.sc-sys.com




Reply With Quote
  #2  
Old   
Russ
 
Posts: n/a

Default Re: FOF not being updated by FILE-SAVE or SAVE - 11-21-2005 , 12:09 PM






There are two file-of-files.
One for the vme, the other ( fsidm,FileOfFiles,) for the fsi files.


Reply With Quote
  #3  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: FOF not being updated by FILE-SAVE or SAVE - 11-21-2005 , 03:24 PM



Neil, I have a solution, see below. In the mean time, about FOF:
D3 has two "fof" files:
dm,file-of-files,
fsi:dm,FileOfFiles,
When you do a save, VME items are logged in the first and FSI items
are logged in the second.

The u90 user exit still doesn't seem to be supported for FSI files.
If you look in dm,bp, get-fof you will see a comment by Mark Brown to
this effect.

If this is code for an end-user site, perhaps part of OSMOSiS, then
even if this code worked, you can't really rely on the end-user having
a complete set of FOF items in the VME or the FSI.

But on to a solution...

Create a program called determine.is.file:
----------------------------
abc = "xxx"
* comment out following line to test for is.file=0
open 'md' to abc else stop ; * causes is.file to return 1
call test.is.file(abc,is.file)
print is.file
----------------------------

Here is program test.is.file:
----------------------------
sub test(var,is.file)
common /isfile/ testvar
testvar = var
open 'md' to f.md else stop ; * handle this better
delete f.md, "isfile.":@pib
is.file = 0
execute "run bp test.is.file2 (as"
read result from f.md,"isfile.":@pib then is.file = 1 else null
delete f.md, "isfile.":@pib
return
----------------------------

Here is program test.is.file2:
----------------------------
common /isfile/ testvar
read dummy from testvar,char(0) else null ; * die here on non-fv
open 'md' to f.md else stop ; * handle this better
write "x" on f.md,"isfile.":@pib
----------------------------

Test procedure:
1) Create, compile, catalog all programs.
2) Run determine.is.file as-is, result should be 1 for the MD.
3) Comment out line 2 of that prog and re-run, result=0.

What's happening is that a read operation on a non-filevar will cause
the program to fall to debug. The (as) options on the Run statement
in test.is.file change this behavior to a full abort with no error
messages. If test.is.file2 does not abort then the var was a filevar
and it should write a flag to the md to signal it was able to progress
beyond the read. The test.is.file prog will read the md item and set
is.file=1. If test.is.file2 does abort then test.is.file won't find a
flag in the md and leaves is.file=0. The trick is to get "something
else" to abort, other than the program actually testing the var. The
var is passed through named common and Execute, since a Call would
cause all programs in the stack to abort.

HTH.
T






"Neil Charrington" <neil (AT) casoftware (DOT) co.uk> wrote:

Quote:
I have tried on numerous occasions to create the FOF for the whole system
but no matter what I try the file numbers for all NEW files that were not in
the original downloaded D3 system (i.e. DM, SQLDEMO etc.) show with a
minus sign "next" to them and they do not appear in the FOF. I have tried
FILE-SAVE, SAVE (s,f,d,g and SAVE (s,f,d,g,t.

Can anyone suggest what I am doing wrong or why this would happen?

The system I am working with is D3 7.4.5 on Win2K3 Server and all of the
accounts/files in question are FSI's.

Thanks.

Neil.

Neil Charrington
S C Systems
T: +44 1564 777011
F: +44 1564 777454
W: www.sc-sys.com




Reply With Quote
  #4  
Old   
Bill H
 
Posts: n/a

Default Re: FOF not being updated by FILE-SAVE or SAVE - 11-21-2005 , 10:04 PM



Neil:

Here's a program that lists the NT (FOF) and (FileOfFiles) files.

The includes are just variable initializations.

Bill

!
** List File-Statistics-Report
!
** Notes:
**
** This is the output listing for the D3 file-statistics report. It
** is a custom report (not much different than the usual LFS report).
**
** It does, however, separate the D3 VME file-stats from the FSI file-
** stats. It does this using the 'V' option (VME) and the 'F' option
** (FSI). The 'F' option can only exist if D3 and if on D3/NT.
**
**-------------------------------------------------------------------**
** **
** I N I T I A L I Z A T I O N **
** **
**-------------------------------------------------------------------**
*
** Initialize common variables
INCLUDE DTABP,INCLUDES SET.COMMON
INCLUDE DTABP,INCLUDES SET.INIT

** assign menu and initialize printer
MENU.NO = "LFS"
PROG.NAME = "LFS"
CALL INIT.OUTPUT ; ** initialize lptr output

* must get last stat# from system frame 1 because file of files
* do not get cleared by each save
STAT.NUM = OCONV('', 'U28') ; ** get file stat# from frame 1

** pass anything else to command from command line
*TclLine = @COMMAND ; ** U2 version
TCLREAD TclLine ; ** D3 version
TclCmds = TRIM(OCONV(TclLine, 'G1 999'))
Options = OCONV(FIELD(TclCmds, '(' , 2), 'MCU')
IF INDEX(TclLine, '?', 1) THEN GOTO DISPLAY.HELP

** set option values (defaults to 'v' option)
a.opt = 0 ; ** output account totals only
f.opt = 0 ; ** include D3 FSI file-stats
p.opt = 0 ; ** print option
v.opt = 0 ; ** include regular file-stats
IF INDEX(Options, 'A', 1) THEN a.opt = 1
IF INDEX(Options, 'F', 1) THEN f.opt = 1 ; ** D3 version
IF INDEX(Options, 'P', 1) THEN p.opt = 1
IF INDEX(Options, 'V', 1) THEN v.opt = 1

** if no file options then default to 'f' and 'v' option
IF NOT(f.opt) AND NOT(v.opt) THEN
f.opt = 1
v.opt = 1
END

** verify 'F' option is only used on D3/NT
IF NOT(OS.VAL) THEN f.opt = 0

** make sure at least the 'V' option is activated
IF NOT(f.opt) AND NOT(v.opt) THEN
v.opt = 1
END

** set print option if using 'LPTR' command
IF COUNT(OCONV(TclCmds , 'MCU') , 'LPTR') THEN
p.opt = 1
END

** setup printer parameters & lead-in string
IF p.opt THEN
SortCmd = 'SORT'
OUTPUT.DEVICE = SYSTEM.PTR ; ** default to system printer
WKAMT = 1:AM:136:VM:0 ; ** assign printer parameters
LPTR.SELECT = LPTR.NO ; ** use user's default printer
CALL SET.STANDARDS ; ** set printer standards
EXECUTE \SP-OPEN\ ; ** set output as one entry#
WKAMT = NULL$
CALL LPTR.SETUP ; ** load printer config cmds
END ELSE
SortCmd = 'SORT'
END
**
**-------------------------------------------------------------------**
** **
** S T A R T P R O G R A M R U N **
** **
**-------------------------------------------------------------------**
*
** Start loop to print report(s)
xHigh = f.opt + v.opt
FOR X = 1 TO xHigh

** if NT then use FsiDm,FileOfFiles, file
BEGIN CASE
CASE v.opt
v.opt = 0 ; ** clear option once used
TclCmd = SortCmd : \ file-of-files\
TclCmd := \ WITH filecode # "[d" AND WITH stat# "\ : STAT.NUM : \"\
TclCmd := \ BY name ID-SUPP\
IF a.opt THEN
TclCmd := \ DET-SUPP\
TclCmd := \ reel# seq# file#\
TclCmd := \ ROLL-ON acct "*** 'BVF'" fname mod \
END ELSE
TclCmd := \ reel# seq# file#\
TclCmd := \ ROLL-ON acct "*** 'BUVF'" fname mod \
END
TclCmd := \ TOTAL bytes TOTAL t-items TOTAL ovf-itms \
TclCmd := \ TOTAL frames TOTAL ptr-fms GRAND-TOTAL "'U'"\
REPORT.NAME = "** VME - FILE STATISTICS REPORT **"
CASE f.opt
f.opt = 0 ; ** clear option once used
TclCmd = SortCmd : \ FileOfFiles\
TclCmd := \ BY filename ID-SUPP\
IF a.opt THEN
TclCmd := \ DET-SUPP\
TclCmd := \ File# FName\
TclCmd := \ ROLL-ON acct "*** 'BVF'"\
END ELSE
TclCmd := \ File# FName\
TclCmd := \ ROLL-ON acct "*** 'BUVF'"\
END
TclCmd := \ Modulo TOTAL Bytes TOTAL Itms TOTAL OvfItms TOTAL
OvfSize\
TclCmd := \ TOTAL OvfGrp TOTAL Reads TOTAL Writes GRAND-TOTAL
"'U'"\
REPORT.NAME = "** FSI - FILE STATISTICS REPORT **"
END CASE

** assign heading
REPORT.NAME<2> = "D3 SPECIAL FILE MANAGEMENT REPORTING"
IF NOT(p.opt) THEN
REPORT.NAME<3> = 1 ; ** no blank above col-hdr
END
CALL BUILD.HEADING (REPORT.NAME)
TclCmd := \ heading "\ : REPORT.NAME : \"\

** load command line additions
IF TclCmds NE NULL$ THEN
TclCmd := SP1 : TclCmds
END

** execute program
EXECUTE TclCmd

** insert form-feed between reports if both are printed
IF X = 1 AND xHigh = 2 THEN
IF p.opt THEN
PRINTER ON
PRINT FF$:
PRINTER OFF
END
END
NEXT X

** reset standards
IF p.opt THEN
VARBL = "LptrEndSkip" ; ** temp removal of end-cmds
CALL LPTR.END ; ** print lptr eoj cmds
EXECUTE \RESET.STANDARDS\ ; ** reset environment parameters
END
*
GOTO END.OF.PROGRAM
*
**----------------------------------------------------------------**
** **
** S U B R O U T I N E S **
** **
**----------------------------------------------------------------**
*
** Help display
***************
DISPLAY.HELP:
***************
*
CRT
CRT 'Utility to list File-Statistics reports'
CRT
CRT "Syntax:"
CRT " Dta.Lfs {additional 'lfs' output} {(options}"
CRT
CRT " * options:"
CRT " A - list [A]ccount totals only"
CRT " F - list [F]si FileOfFiles only"
CRT " P - list output to [P]rinter"
CRT " V - list [V]ME File-of-Files"
CRT
CRT "Note: No options acts like 'v' unless D3/NT, which acts"
CRT " like both the 'f' and 'v' options"
CRT
STOP
*
**----------------------------------------------------------------**
** **
** E N D O F P R O G R A M **
** **
**----------------------------------------------------------------**
*
***************
END.OF.PROGRAM:
***************
*
CALL INIT.OUTPUT ; ** initialize printer output
END

"Neil Charrington" <neil (AT) casoftware (DOT) co.uk> wrote

Quote:
I have tried on numerous occasions to create the FOF for the whole system
but no matter what I try the file numbers for all NEW files that were not
in the original downloaded D3 system (i.e. DM, SQLDEMO etc.) show with a
minus sign "next" to them and they do not appear in the FOF. I have tried
FILE-SAVE, SAVE (s,f,d,g and SAVE (s,f,d,g,t.

Can anyone suggest what I am doing wrong or why this would happen?

The system I am working with is D3 7.4.5 on Win2K3 Server and all of the
accounts/files in question are FSI's.

Thanks.

Neil.

Neil Charrington
S C Systems
T: +44 1564 777011
F: +44 1564 777454
W: www.sc-sys.com






Reply With Quote
  #5  
Old   
Neil Charrington
 
Posts: n/a

Default Re: FOF not being updated by FILE-SAVE or SAVE - 11-22-2005 , 02:07 AM



Tony,

Thanks for the solution, although this still won't get me the file name.
Surely the first 12 lines of the WhatHaveIGot routine from Mike Preece will
give the same result or does the line

"if CheckIds<2>='' then"

rely on there being some data in the file when the line

"select FileVariable to CheckIds"

is executed?

Best regards,

Neil.

"Tony Gravagno" <g6q3x9lu53001 (AT) sneakemail (DOT) com.invalid> wrote

Quote:
Neil, I have a solution, see below. In the mean time, about FOF:
D3 has two "fof" files:
dm,file-of-files,
fsi:dm,FileOfFiles,
When you do a save, VME items are logged in the first and FSI items
are logged in the second.

The u90 user exit still doesn't seem to be supported for FSI files.
If you look in dm,bp, get-fof you will see a comment by Mark Brown to
this effect.

If this is code for an end-user site, perhaps part of OSMOSiS, then
even if this code worked, you can't really rely on the end-user having
a complete set of FOF items in the VME or the FSI.

But on to a solution...

Create a program called determine.is.file:
----------------------------
abc = "xxx"
* comment out following line to test for is.file=0
open 'md' to abc else stop ; * causes is.file to return 1
call test.is.file(abc,is.file)
print is.file
----------------------------

Here is program test.is.file:
----------------------------
sub test(var,is.file)
common /isfile/ testvar
testvar = var
open 'md' to f.md else stop ; * handle this better
delete f.md, "isfile.":@pib
is.file = 0
execute "run bp test.is.file2 (as"
read result from f.md,"isfile.":@pib then is.file = 1 else null
delete f.md, "isfile.":@pib
return
----------------------------

Here is program test.is.file2:
----------------------------
common /isfile/ testvar
read dummy from testvar,char(0) else null ; * die here on non-fv
open 'md' to f.md else stop ; * handle this better
write "x" on f.md,"isfile.":@pib
----------------------------

Test procedure:
1) Create, compile, catalog all programs.
2) Run determine.is.file as-is, result should be 1 for the MD.
3) Comment out line 2 of that prog and re-run, result=0.

What's happening is that a read operation on a non-filevar will cause
the program to fall to debug. The (as) options on the Run statement
in test.is.file change this behavior to a full abort with no error
messages. If test.is.file2 does not abort then the var was a filevar
and it should write a flag to the md to signal it was able to progress
beyond the read. The test.is.file prog will read the md item and set
is.file=1. If test.is.file2 does abort then test.is.file won't find a
flag in the md and leaves is.file=0. The trick is to get "something
else" to abort, other than the program actually testing the var. The
var is passed through named common and Execute, since a Call would
cause all programs in the stack to abort.

HTH.
T






"Neil Charrington" <neil (AT) casoftware (DOT) co.uk> wrote:

I have tried on numerous occasions to create the FOF for the whole system
but no matter what I try the file numbers for all NEW files that were not
in
the original downloaded D3 system (i.e. DM, SQLDEMO etc.) show with a
minus sign "next" to them and they do not appear in the FOF. I have tried
FILE-SAVE, SAVE (s,f,d,g and SAVE (s,f,d,g,t.

Can anyone suggest what I am doing wrong or why this would happen?

The system I am working with is D3 7.4.5 on Win2K3 Server and all of the
accounts/files in question are FSI's.

Thanks.

Neil.

Neil Charrington
S C Systems
T: +44 1564 777011
F: +44 1564 777454
W: www.sc-sys.com






Reply With Quote
  #6  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: FOF not being updated by FILE-SAVE or SAVE - 11-22-2005 , 01:44 PM



Neil, my goal was to solve the problem of determining whether a
variable points to a file or not. Maybe I should have posted the
solution to the other thread.

I don't know about getting the filename, and for D3 FSI I don't think
there is a solution for determining the filename just from the file
descriptor. You could file an action item for enhancement with RD
Support to get u90 to work in the FSI, but that doesn't help now, and
I doubt they'd get to this one anytime soon. Traditional coding which
attempts to organize file names and vars frequently includes using
dimensioned files(n,2) arrays where the first element is the name and
the second is the pointer, or something similar. This is one of the
areas where I draw a line about the end-user being sloppy about their
code - some organization is required on the front-end here if you want
to know what's happening later. If you have any intent of porting
this code to other platforms then it's much better to have a simple
and cross-platform way to do things, even if it means restructuring of
your variables. Otherwise you're just going to have to write more
platform-specific code later to duplicate the functionality of u90,
FOF, and/or the '(A,S)' options on the Run verb.

Regards,
T

"Neil Charrington" <neil (AT) casoftware (DOT) co.uk> wrote:

Quote:
Tony,

Thanks for the solution, although this still won't get me the file name.
Surely the first 12 lines of the WhatHaveIGot routine from Mike Preece will
give the same result or does the line

"if CheckIds<2>='' then"

rely on there being some data in the file when the line

"select FileVariable to CheckIds"

is executed?

Best regards,

Neil.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.