dbTalk Databases Forums  

Checking dicts on unidata

comp.databases.pick comp.databases.pick


Discuss Checking dicts on unidata in the comp.databases.pick forum.



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

Default Checking dicts on unidata - 07-10-2006 , 04:31 AM






Hi,

I've tried to write a program to validate all my dicts in all my files
on my system (we are porting from mvbase to unidata). Basically i've
tried selecting all files, then selecting all dicts per file, then list
file dict and checking the output.

The problem is, when executing a virtual dict which is invalid the
program bombs out;

LIST PLANNINGMZ TEST 10:29:27 10 JUL 2006 1
PLANNINGMZ TEST................

'BPUSER TESTTESTTEST' is not cataloged.
Virtual Attribute Error: BPUSER TESTTESTTEST Indirect call error.

I thought about using COMPILE.DICT, but that seems to just check the
syntax.

Any ideas anyone?

Thanks.


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

Default Re: Checking dicts on unidata - 07-10-2006 , 05:54 AM






Is your virtual dict calling a subroutine ? - ie.. the BPUSER
TESTTESTTEST entry.

If so you will need to compile and catalog all of these as well first.


rgds
Symeon.


russell_a_brooke (AT) yahoo (DOT) co.uk wrote:
Quote:
Hi,

I've tried to write a program to validate all my dicts in all my files
on my system (we are porting from mvbase to unidata). Basically i've
tried selecting all files, then selecting all dicts per file, then list
file dict and checking the output.

The problem is, when executing a virtual dict which is invalid the
program bombs out;

LIST PLANNINGMZ TEST 10:29:27 10 JUL 2006 1
PLANNINGMZ TEST................

'BPUSER TESTTESTTEST' is not cataloged.
Virtual Attribute Error: BPUSER TESTTESTTEST Indirect call error.

I thought about using COMPILE.DICT, but that seems to just check the
syntax.

Any ideas anyone?

Thanks.


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-10-2006 , 07:20 AM



Have you tried using a statement such as

EXECUTE 'LIST PLANNINGMZ TEST' CAPTURING CCCC RETURNING RRRR

in your test program, and you can then inspect the contents of CCCC
and/or RRRR to see whether it blew up or not.

Regards

Malcolm Bull


Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-10-2006 , 10:13 AM



MBTraining (AT) aol (DOT) com wrote:
Quote:
Have you tried using a statement such as

EXECUTE 'LIST PLANNINGMZ TEST' CAPTURING CCCC RETURNING RRRR

in your test program, and you can then inspect the contents of CCCC
and/or RRRR to see whether it blew up or not.

Regards

Malcolm Bull
Hi Malcolm,

That's what i tried to do to start off with. Problem is that if you
execute a LIST PLANNINGMZ TEST and the TEST is a duff virtual dict, the
program bombs out to tcl. Try doing this to see what i mean;

1. CREATE a tempfile called RBTEMP
2. Create 2 duff dicts called TEST1 and TEST2 (See dict example)
3. Cut and paste code and run (See code example)

You'll see the program bombs out after trying to execute the first duff
statement. I want the program to carry on.


Dict Example
duff dicts;
TEST1 and TEST2
0001 V
0002 SUBR("NOTGOINGTOWORK",@ID)
0003
0004 RBTEMP
0005 40L
0006 M
0007

Program Example
PROMPT ""
OPEN "DICT","RBTEMP" TO RBTEMP ELSE STOP
COMMAND = "SSELECT DICT RBTEMP"
EXECUTE COMMAND CAPTURING OUTPUT
DICTLIST = ""
LOOP
READNEXT KEY ELSE KEY = ""
UNTIL KEY = "" DO
DICTLIST = DICTLIST : KEY :@AM
REPEAT
NOOFITEMS = DCOUNT(DICTLIST,@AM)
NOOFITEMS = NOOFITEMS - 1
*
FOR I = 1 TO NOOFITEMS
COMMAND = "LIST RBTEMP "ICTLIST<I>
CRT COMMAND
EXECUTE COMMAND CAPTURING OUTPUT RETURNING ERROR
CRT OUTPUT<1>
COMMAND = "Q"
EXECUTE COMMAND CAPTURING OUTPUT RETURNING ERROR
NEXT I
*



Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-10-2006 , 10:17 AM




Symeon wrote:
Quote:
Is your virtual dict calling a subroutine ? - ie.. the BPUSER
TESTTESTTEST entry.

If so you will need to compile and catalog all of these as well first.


rgds
Symeon.


Hi Symeon,

Thanks for the reply.

I know the program in the being called from the dict should be compiled
and cataloged. I'm trying to write a program which will check all
files, all dicts, check the output and then create a list of dicts to
correct. There are about 50,000 dicts in total against all files which
is why i'm writing a program auto validate all dicts in all files.

Thanks.



Reply With Quote
  #6  
Old   
frosty
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-10-2006 , 11:44 AM



Quote:
MBTraining (AT) aol (DOT) com wrote:
Have you tried using a statement such as

EXECUTE 'LIST PLANNINGMZ TEST' CAPTURING CCCC RETURNING RRRR

in your test program, and you can then inspect the contents of CCCC
and/or RRRR to see whether it blew up or not.

Regards

Malcolm Bull

Hi Malcolm,

russell_a_brooke (AT) yahoo (DOT) co.uk wrote:
That's what i tried to do to start off with. Problem is that if you
execute a LIST PLANNINGMZ TEST and the TEST is a duff virtual dict,
the program bombs out to tcl. Try doing this to see what i mean;

1. CREATE a tempfile called RBTEMP
2. Create 2 duff dicts called TEST1 and TEST2 (See dict example)
3. Cut and paste code and run (See code example)

You'll see the program bombs out after trying to execute the first
duff statement. I want the program to carry on.


Dict Example
duff dicts;
TEST1 and TEST2
0001 V
0002 SUBR("NOTGOINGTOWORK",@ID)
0003
0004 RBTEMP
0005 40L
0006 M
0007

Program Example
PROMPT ""
OPEN "DICT","RBTEMP" TO RBTEMP ELSE STOP
COMMAND = "SSELECT DICT RBTEMP"
EXECUTE COMMAND CAPTURING OUTPUT
DICTLIST = ""
LOOP
READNEXT KEY ELSE KEY = ""
UNTIL KEY = "" DO
DICTLIST = DICTLIST : KEY :@AM
REPEAT
NOOFITEMS = DCOUNT(DICTLIST,@AM)
NOOFITEMS = NOOFITEMS - 1
*
FOR I = 1 TO NOOFITEMS
COMMAND = "LIST RBTEMP "ICTLIST<I
CRT COMMAND
EXECUTE COMMAND CAPTURING OUTPUT RETURNING ERROR
CRT OUTPUT<1
COMMAND = "Q"
EXECUTE COMMAND CAPTURING OUTPUT RETURNING ERROR
NEXT I
*
Start a phantom process to execute the command, then check
the phantom process log, aka the _PH_ file.

--
frosty




Reply With Quote
  #7  
Old   
Symeon
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-10-2006 , 01:49 PM



OK - an I type dict that uses SUBR is the same as having a CALL in your
program, if the subroutine it is calling is not cataloged it will crash
out. I dont think there is anything you can do about that !

You could instead read in the name of the subroutine in the dict and
write that away to a list of subroutines you need to compile and
catalog.


rgds
Symeon.
russell_a_brooke (AT) yahoo (DOT) co.uk wrote:
Quote:
Symeon wrote:
Is your virtual dict calling a subroutine ? - ie.. the BPUSER
TESTTESTTEST entry.

If so you will need to compile and catalog all of these as well first.


rgds
Symeon.



Hi Symeon,

Thanks for the reply.

I know the program in the being called from the dict should be compiled
and cataloged. I'm trying to write a program which will check all
files, all dicts, check the output and then create a list of dicts to
correct. There are about 50,000 dicts in total against all files which
is why i'm writing a program auto validate all dicts in all files.

Thanks.


Reply With Quote
  #8  
Old   
AT
 
Posts: n/a

Default Re: Checking dicts on unidata - 07-11-2006 , 03:24 AM




Quote:
Start a phantom process to execute the command, then check
the phantom process log, aka the _PH_ file.

--
frosty
Good plan, i'll give that a go.

Thanks.

Russ



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

Default Re: Checking dicts on unidata - 07-12-2006 , 11:06 AM



Russ:

There are a number of UDT.OPTIONS that affect UniBASIC. UDT.OPTIONS 41 is
the one I believe you want. So do the following:

EXECUTE \UDT.OPTIONS 41 ON\
EXECUTE \LIST FILENAME TESTDICT\ CAPTURING OUTPUT
EXECUTE \UDT.OPTIONS 41 OFF
CRT OUTPUT
Hope this helps.

Bill


<russell_a_brooke (AT) yahoo (DOT) co.uk> wrote

Quote:

Start a phantom process to execute the command, then check
the phantom process log, aka the _PH_ file.

--
frosty

Good plan, i'll give that a go.

Thanks.

Russ




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.