List of globals stored in a .GOF file

86 views
Skip to first unread message

Marcelo Blasco

unread,
Nov 10, 2004, 5:30:56 AM11/10/04
to x...@info2.kinich.com
Hi everybody.

I'm trying to use $$main^%Wgr to export and import globals using the .GOF
format since it's faster. Right now, I can export them in that format but I
don't know how to import them. For what I now, when the GOF format is used,
to import it it's necessary to fill the ^%utility($J) global with the list
of globals in the GOF file.

Does anybody know how to fill the ^%utility($J) with the list of globals
stored in a .GOF file?

Thanks.

Marcelo.



Alessandro Nucci

unread,
Nov 10, 2004, 5:52:00 AM11/10/04
to x...@info2.kinich.com
Hi, try this:

----- global import-----
s IO="c:\myFile.gof"
s IOPAR="UR"
s IOT="RMS"
s mode=0
s ret=$$entry^%GIF(mode)
------------------------
mode (0 = skip existing, 1 = merge)

Regards,
Alessandro

"Marcelo Blasco" <mpbl...@hotmail.com> ha scritto nel messaggio
news:4191e...@info2.kinich.com...

Marcelo Blasco

unread,
Nov 10, 2004, 6:18:49 AM11/10/04
to x...@info2.kinich.com
Hi.

Thanks for your answer, it really works.

Anyway, I still need to:
1) Get the list of globals in a .GOF file, if possible. Otherwise, I will
have to store in the text file the list of globals exported in the GOF file.
2) Import the globals replacing the existing ones (not merging). Is there an
additional mode that is overwrite instead of merge or should I get the list
of globals and them kill each of them before importing them?

Thanks.

Marcelo.


"Alessandro Nucci" <alessand...@prosasrl.it> escribió en el mensaje
news:4191f...@info2.kinich.com...
> Hi, try this:
>
> ----- global import-----
> s IO="c:\myFile.gof"
> s IOPAR="UR"
> s IOT="RMS"
> s mode=0
> s ret=$$entry^%GIF(mode)
> ------------------------
> mode (0 = skip existing, 1 = merge)
>
> Regards,
> Alessandro
>
> "Marcelo Blasco" <mpbl...@hotmail.com> ha scritto nel messaggio
> news:4191e...@info2.kinich.com...
> > Hi everybody.
> >
> > I'm trying to use $$main^%Wgr to export and import globals using the
..GOF

Dan Trampler

unread,
Nov 10, 2004, 6:26:18 AM11/10/04
to x...@info2.kinich.com
1) take a look at $$globals^%GIF:

listglo ;create list of imported globals
;n usebuf,external,glomerge,glo
s usebuf=0,external=1,glomerge=1
i '$$head^%GIF(1) q ; call that only to open a file properly
i '$$globals^%GIF q ; create global list in global ^mtemp1("%GIF")
s glo=""
f s glo=$o(^mtemp1("%GIF",glo)) q:glo="" s:mode'=3&$d(@glo)!(mode=3)
^%zTemp($j,"IMPORT",$i(^%zTemp($j,"IMPORT")))=glo
q

2) $$entry^%GIF(0)

Dan


"Marcelo Blasco" <mpbl...@hotmail.com> píąe v diskusním příspěvku
news:4191f...@info2.kinich.com...

Marcelo Blasco

unread,
Nov 10, 2004, 9:44:57 AM11/10/04
to x...@info2.kinich.com
Hi Dan.

How can I take a look at $$globals^%GIF? I cannot get to see the source code
for ^%GIF. Is there any place where I can get the documentation for that
routine? I'm using Cache 5.0.4.

Anyway, two questions:
1) Can I invoke this "listglo" routine before importing the .GOF file
(that's what I need)? I'm getting an undefined error:
An error occurred while attempting to open the next volume:
<UNDEFINED>mnt+1^%GIF

Before invoking listglo, I tried to do
s IO="C:\RTCMSDITOM15 - HCA\GLOBALS\HCA.gof"
s IOPAR="UR"
s IOT="RMS"
s mode=1
but it's still complaining about the undefined error.

2) I haven't understood the command "$$entry^%GIF(0)". Isn't it supposed to
not overwrite existing globals? What I really need is the opposite: to erase
and then replace the existing globals with the ones stored in the GOF file.
Or should I get the listglo array, kill the globals manually and then invoke
"$$entry^%GIF(0)".

Sorry to be bothering that much. Thanks.

Marcelo.


"Dan Trampler" <d...@nlm.cz> escribió en el mensaje

Dan Trampler

unread,
Nov 10, 2004, 11:31:26 AM11/10/04
to x...@info2.kinich.com
In order to get source codes you have to check "load utilities" or something
like that at Cache install time. To avoid complete Cache re-install you can
import %cache_installation%\Install\cutil.rtn.

To run $$globals without <undefined> error should be enough to set following
variables before the call:
IO=filename
IOPAR="UR"
IOT="RMS"
usebuf=0
external=1
glomerge=1
If you still get an error you have to investigate the GIF source.

To simulate replace mode just kill the global before import is proceeded
(first you have to retrieve the list of imported globals :-).

Dan

"Marcelo Blasco" <mpbl...@hotmail.com> píąe v diskusním příspěvku
news:41922...@info2.kinich.com...

Marcelo Blasco

unread,
Nov 11, 2004, 2:08:18 AM11/11/04
to x...@info2.kinich.com
Hi Dan.

I've found the problem. The problem was not the invocation of $$globals, but
the invocation of $$head. If that is to be called directly, IOPAR should be
set to "(""UR"")" instead of just "UR".

Marcelo.


"Dan Trampler" <d...@nlm.cz> escribió en el mensaje
news:41924...@info2.kinich.com...
Reply all
Reply to author
Forward
0 new messages