Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Knowledge, sir, should be free to all! -- Harry Mudd, "I, Mudd", stardate 4513.3


devel / comp.lang.mumps / Re: How to capture ZLINK errors programatically?

SubjectAuthor
* How to capture ZLINK errors programatically?kdtop
`* Re: How to capture ZLINK errors programatically?Jens
 +* Re: How to capture ZLINK errors programatically?K.S. Bhaskar
 |`* Re: How to capture ZLINK errors programatically?kdtop
 | `* Re: How to capture ZLINK errors programatically?K.S. Bhaskar
 |  `* Re: How to capture ZLINK errors programatically?kdtop
 |   `* Re: How to capture ZLINK errors programatically?Jens Lideström
 |    `- Re: How to capture ZLINK errors programatically?K.S. Bhaskar
 `- Re: How to capture ZLINK errors programatically?kdtop

1
How to capture ZLINK errors programatically?

<dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=442&group=comp.lang.mumps#442

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:622a:1651:b0:344:5d06:7449 with SMTP id y17-20020a05622a165100b003445d067449mr142003qtj.292.1660771352355;
Wed, 17 Aug 2022 14:22:32 -0700 (PDT)
X-Received: by 2002:ac8:5f53:0:b0:343:a8d0:c81b with SMTP id
y19-20020ac85f53000000b00343a8d0c81bmr115957qta.489.1660771352078; Wed, 17
Aug 2022 14:22:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Wed, 17 Aug 2022 14:22:31 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=173.164.29.153; posting-account=siWvwQoAAACYCGtn7kPrEYinJEra-Oc0
NNTP-Posting-Host: 173.164.29.153
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
Subject: How to capture ZLINK errors programatically?
From: kdtop3@gmail.com (kdtop)
Injection-Date: Wed, 17 Aug 2022 21:22:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2214
 by: kdtop - Wed, 17 Aug 2022 21:22 UTC

I have reviewed the ZLINK documentation here:

https://docs.yottadb.com/ProgrammersGuide/commands.html#zlink

I would like to ZLINK a routine at runtime, and be aware if the compilation and linking generated any errors.

For example, I created a routine named TEST2, with the following erroneous code:

CHKERR2
SET X=
QUIT

And then I made another routine, TEST, with the following code.

CHKERR
DO
. NEW $ETRAP
. SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
. ZLINK "TMGTEST2"
QUIT

CHKMATHERR
DO
. NEW $ETRAP
. SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
. WRITE 1/0
QUIT

When I run this code, I can trap a divide by 0 error, but not a ZLINK error

yottadb>ZL "TMGTEST"

yottadb>do CHKERR^TMGTEST
SET X=
^-----
At column 9, line 1006, source module /opt/worldvista/EHR/p/TMGTEST2.m
%YDB-E-EXPR, Expression expected but not found

yottadb>do CHKMATHERR^TMGTEST
Error Trapped: ,M9,Z150373210,

Question:
Is there a way to trap a zlink error (in this case, a "%YDB-E-EXPR, Expression expected but not found")?

Thanks

Kevin

Re: How to capture ZLINK errors programatically?

<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=443&group=comp.lang.mumps#443

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:4542:b0:6b3:7c51:6177 with SMTP id u2-20020a05620a454200b006b37c516177mr54036qkp.306.1660772579008;
Wed, 17 Aug 2022 14:42:59 -0700 (PDT)
X-Received: by 2002:a05:620a:3724:b0:6bb:7564:e388 with SMTP id
de36-20020a05620a372400b006bb7564e388mr43871qkb.564.1660772576295; Wed, 17
Aug 2022 14:42:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Wed, 17 Aug 2022 14:42:56 -0700 (PDT)
In-Reply-To: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:d5:e71d:9e00:86:8929:bbd2:52aa;
posting-account=Fb5loAoAAAAWGHFa1kwW5TIlX7XcPFIS
NNTP-Posting-Host: 2003:d5:e71d:9e00:86:8929:bbd2:52aa
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: jewu34@web.de (Jens)
Injection-Date: Wed, 17 Aug 2022 21:42:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2667
 by: Jens - Wed, 17 Aug 2022 21:42 UTC

kdtop schrieb am Mittwoch, 17. August 2022 um 23:22:33 UTC+2:
> I have reviewed the ZLINK documentation here:
>
> https://docs.yottadb.com/ProgrammersGuide/commands.html#zlink
>
> I would like to ZLINK a routine at runtime, and be aware if the compilation and linking generated any errors.
>
> For example, I created a routine named TEST2, with the following erroneous code:
>
> CHKERR2
> SET X=
> QUIT
>
> And then I made another routine, TEST, with the following code.
>
> CHKERR
> DO
> . NEW $ETRAP
> . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> . ZLINK "TMGTEST2"
> QUIT
>
> CHKMATHERR
> DO
> . NEW $ETRAP
> . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> . WRITE 1/0
> QUIT
>

I don't know how to do it with ZLINK, but maybe my Workaround helps you:

TESTCOMPILE(FILE,RESULT) ;Compile FILE (no Object File created and return possible Errors in .RESULT
N IO,PIPE,I,LINE
S IO=$IO
S PIPE="PIPE"
KILL RESULT
O PIPE:(shell="/bin/bash":command="$gtm_dist/mumps -noobject "_FILE_" && echo '***READY'":readonly)::"PIPE"
U PIPE
S I=1000
F Q:$ZEOF R LINE Q:LINE="***READY" D
. I $E(LINE,1,12)=($C(9,9)_"At column ") S RESULT(I)=$P($P(LINE,"At column ",2),",",1)_";"_$P($P(LINE,"line ",2),",",1)_";"
. I $E(LINE,1,4)="%YDB"!($E(LINE,1,4)="%GTM") S:$G(RESULT(I))="" RESULT(I)=";;" S RESULT(I)=RESULT(I)_LINE,I=I+1
C PIPE
U IO
Q

Jens

Re: How to capture ZLINK errors programatically?

<a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=444&group=comp.lang.mumps#444

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:128a:b0:6bb:5a52:6dd8 with SMTP id w10-20020a05620a128a00b006bb5a526dd8mr655478qki.350.1660787262971;
Wed, 17 Aug 2022 18:47:42 -0700 (PDT)
X-Received: by 2002:a05:6214:262f:b0:477:734:3177 with SMTP id
gv15-20020a056214262f00b0047707343177mr698531qvb.67.1660787262740; Wed, 17
Aug 2022 18:47:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Wed, 17 Aug 2022 18:47:42 -0700 (PDT)
In-Reply-To: <5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.36.235.25; posting-account=zTPg1AoAAABx_LtAQ3dW6FBnU1dwmSvl
NNTP-Posting-Host: 108.36.235.25
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com> <5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: ksbhaskar@gmail.com (K.S. Bhaskar)
Injection-Date: Thu, 18 Aug 2022 01:47:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3406
 by: K.S. Bhaskar - Thu, 18 Aug 2022 01:47 UTC

On Wednesday, August 17, 2022 at 5:42:59 PM UTC-4, Jens wrote:
> kdtop schrieb am Mittwoch, 17. August 2022 um 23:22:33 UTC+2:
> > I have reviewed the ZLINK documentation here:
> >
> > https://docs.yottadb.com/ProgrammersGuide/commands.html#zlink
> >
> > I would like to ZLINK a routine at runtime, and be aware if the compilation and linking generated any errors.
> >
> > For example, I created a routine named TEST2, with the following erroneous code:
> >
> > CHKERR2
> > SET X=
> > QUIT
> >
> > And then I made another routine, TEST, with the following code.
> >
> > CHKERR
> > DO
> > . NEW $ETRAP
> > . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> > . ZLINK "TMGTEST2"
> > QUIT
> >
> > CHKMATHERR
> > DO
> > . NEW $ETRAP
> > . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> > . WRITE 1/0
> > QUIT
> >
> I don't know how to do it with ZLINK, but maybe my Workaround helps you:
>
> TESTCOMPILE(FILE,RESULT) ;Compile FILE (no Object File created and return possible Errors in .RESULT
> N IO,PIPE,I,LINE
> S IO=$IO
> S PIPE="PIPE"
> KILL RESULT
> O PIPE:(shell="/bin/bash":command="$gtm_dist/mumps -noobject "_FILE_" && echo '***READY'":readonly)::"PIPE"
> U PIPE
> S I=1000
> F Q:$ZEOF R LINE Q:LINE="***READY" D
> . I $E(LINE,1,12)=($C(9,9)_"At column ") S RESULT(I)=$P($P(LINE,"At column ",2),",",1)_";"_$P($P(LINE,"line ",2),",",1)_";"
> . I $E(LINE,1,4)="%YDB"!($E(LINE,1,4)="%GTM") S:$G(RESULT(I))="" RESULT(I)=";;" S RESULT(I)=RESULT(I)_LINE,I=I+1
> C PIPE
> U IO
> Q
>
> Jens

$ZCSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zcstatus) captures the result of a ZCOMPILE. I don't know whether it captures the result of a ZLINK and I can't check right now, but in case it does not, you can always do ZCOMPILE before doing the ZLINK (which in any case only recompiles if necessary).

Regards
– Bhaskar

Re: How to capture ZLINK errors programatically?

<bf650abf-466f-4f9f-a7d7-aae41355e717n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=445&group=comp.lang.mumps#445

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:688:b0:6bb:29aa:4ce4 with SMTP id f8-20020a05620a068800b006bb29aa4ce4mr1833808qkh.18.1660825981452;
Thu, 18 Aug 2022 05:33:01 -0700 (PDT)
X-Received: by 2002:a05:620a:3724:b0:6bb:7564:e388 with SMTP id
de36-20020a05620a372400b006bb7564e388mr1859978qkb.564.1660825980994; Thu, 18
Aug 2022 05:33:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 18 Aug 2022 05:33:00 -0700 (PDT)
In-Reply-To: <5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=173.164.29.153; posting-account=siWvwQoAAACYCGtn7kPrEYinJEra-Oc0
NNTP-Posting-Host: 173.164.29.153
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com> <5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bf650abf-466f-4f9f-a7d7-aae41355e717n@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: kdtop3@gmail.com (kdtop)
Injection-Date: Thu, 18 Aug 2022 12:33:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 54
 by: kdtop - Thu, 18 Aug 2022 12:33 UTC

On Wednesday, August 17, 2022 at 5:42:59 PM UTC-4, Jens wrote:

Jens,

Thanks for taking the time to put all this together. I appreciated it!

Kevin

> kdtop schrieb am Mittwoch, 17. August 2022 um 23:22:33 UTC+2:
> > I have reviewed the ZLINK documentation here:
> >
> > https://docs.yottadb.com/ProgrammersGuide/commands.html#zlink
> >
> > I would like to ZLINK a routine at runtime, and be aware if the compilation and linking generated any errors.
> >
> > For example, I created a routine named TEST2, with the following erroneous code:
> >
> > CHKERR2
> > SET X=
> > QUIT
> >
> > And then I made another routine, TEST, with the following code.
> >
> > CHKERR
> > DO
> > . NEW $ETRAP
> > . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> > . ZLINK "TMGTEST2"
> > QUIT
> >
> > CHKMATHERR
> > DO
> > . NEW $ETRAP
> > . SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
> > . WRITE 1/0
> > QUIT
> >
> I don't know how to do it with ZLINK, but maybe my Workaround helps you:
>
> TESTCOMPILE(FILE,RESULT) ;Compile FILE (no Object File created and return possible Errors in .RESULT
> N IO,PIPE,I,LINE
> S IO=$IO
> S PIPE="PIPE"
> KILL RESULT
> O PIPE:(shell="/bin/bash":command="$gtm_dist/mumps -noobject "_FILE_" && echo '***READY'":readonly)::"PIPE"
> U PIPE
> S I=1000
> F Q:$ZEOF R LINE Q:LINE="***READY" D
> . I $E(LINE,1,12)=($C(9,9)_"At column ") S RESULT(I)=$P($P(LINE,"At column ",2),",",1)_";"_$P($P(LINE,"line ",2),",",1)_";"
> . I $E(LINE,1,4)="%YDB"!($E(LINE,1,4)="%GTM") S:$G(RESULT(I))="" RESULT(I)=";;" S RESULT(I)=RESULT(I)_LINE,I=I+1
> C PIPE
> U IO
> Q
>
> Jens

Re: How to capture ZLINK errors programatically?

<6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=446&group=comp.lang.mumps#446

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:622a:410:b0:33b:72b2:6038 with SMTP id n16-20020a05622a041000b0033b72b26038mr2377191qtx.627.1660826152078;
Thu, 18 Aug 2022 05:35:52 -0700 (PDT)
X-Received: by 2002:a37:60a:0:b0:6bb:1698:277f with SMTP id
10-20020a37060a000000b006bb1698277fmr1916728qkg.454.1660826151827; Thu, 18
Aug 2022 05:35:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 18 Aug 2022 05:35:51 -0700 (PDT)
In-Reply-To: <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=173.164.29.153; posting-account=siWvwQoAAACYCGtn7kPrEYinJEra-Oc0
NNTP-Posting-Host: 173.164.29.153
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com> <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: kdtop3@gmail.com (kdtop)
Injection-Date: Thu, 18 Aug 2022 12:35:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2778
 by: kdtop - Thu, 18 Aug 2022 12:35 UTC

On Wednesday, August 17, 2022 at 9:47:43 PM UTC-4, K.S. Bhaskar wrote:
> On Wednesday, August 17, 2022 at 5:42:59 PM UTC-4, Jens wrote:
> > kdtop schrieb am Mittwoch, 17. August 2022 um 23:22:33 UTC+2:
> > > I have reviewed the ZLINK documentation here:
> > >
....
> $ZCSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zcstatus) captures the result of a ZCOMPILE. I don't know whether it captures the result of a ZLINK and I can't check right now, but in case it does not, you can always do ZCOMPILE before doing the ZLINK (which in any case only recompiles if necessary).
>
> Regards
> – Bhaskar

Bhaskar,

Thanks for this reply. I did some more digging in the documentation about $ZCSTATUS and ZCOMPILE, and it seems that $ZSTATUS also returns information.. Actually more verbose info:

yottadb>zcompile "/opt/worldvista/EHR/p/TMGTEST2.m"
SET X ^-----
At column 9, line 1006, source module /opt/worldvista/EHR/p/TMGTEST2.m
%YDB-E-EXPR, Expression expected but not found

yottadb>W $ZSTATUS
150373210,CHKMATHERR+4^TMGTEST,%YDB-E-DIVZERO, Attempt to divide by zero
yottadb>W $ZCSTATUS
150372778
yottadb>

What keywords should I search for in the documentation to learn the meaning of the numbers for $ZCSTATUS? E.g. 150372778? There seems to be a difference between the numbers given for $ZSTATUS and $ZCSTATUS.

Thanks again
Kevin

Re: How to capture ZLINK errors programatically?

<c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=447&group=comp.lang.mumps#447

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:6214:c8f:b0:491:76f9:b318 with SMTP id r15-20020a0562140c8f00b0049176f9b318mr2726625qvr.22.1660834729909;
Thu, 18 Aug 2022 07:58:49 -0700 (PDT)
X-Received: by 2002:ac8:7f44:0:b0:344:5693:a913 with SMTP id
g4-20020ac87f44000000b003445693a913mr2986795qtk.454.1660834729722; Thu, 18
Aug 2022 07:58:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 18 Aug 2022 07:58:49 -0700 (PDT)
In-Reply-To: <6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.36.235.25; posting-account=zTPg1AoAAABx_LtAQ3dW6FBnU1dwmSvl
NNTP-Posting-Host: 108.36.235.25
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com> <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
<6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: ksbhaskar@gmail.com (K.S. Bhaskar)
Injection-Date: Thu, 18 Aug 2022 14:58:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3341
 by: K.S. Bhaskar - Thu, 18 Aug 2022 14:58 UTC

On Thursday, August 18, 2022 at 8:35:52 AM UTC-4, kdtop wrote:
> On Wednesday, August 17, 2022 at 9:47:43 PM UTC-4, K.S. Bhaskar wrote:
> > On Wednesday, August 17, 2022 at 5:42:59 PM UTC-4, Jens wrote:
> > > kdtop schrieb am Mittwoch, 17. August 2022 um 23:22:33 UTC+2:
> > > > I have reviewed the ZLINK documentation here:
> > > >
> ...
> > $ZCSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zcstatus) captures the result of a ZCOMPILE. I don't know whether it captures the result of a ZLINK and I can't check right now, but in case it does not, you can always do ZCOMPILE before doing the ZLINK (which in any case only recompiles if necessary).
> >
> > Regards
> > – Bhaskar
> Bhaskar,
>
> Thanks for this reply. I did some more digging in the documentation about $ZCSTATUS and ZCOMPILE, and it seems that $ZSTATUS also returns information. Actually more verbose info:
>
> yottadb>zcompile "/opt/worldvista/EHR/p/TMGTEST2.m"
> SET X=
> ^-----
> At column 9, line 1006, source module /opt/worldvista/EHR/p/TMGTEST2.m
> %YDB-E-EXPR, Expression expected but not found
> yottadb>W $ZSTATUS
> 150373210,CHKMATHERR+4^TMGTEST,%YDB-E-DIVZERO, Attempt to divide by zero
> yottadb>W $ZCSTATUS
> 150372778
> yottadb>
>
>
> What keywords should I search for in the documentation to learn the meaning of the numbers for $ZCSTATUS? E.g. 150372778? There seems to be a difference between the numbers given for $ZSTATUS and $ZCSTATUS.
>
> Thanks again
> Kevin

Kevin –

$ZSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zstatus) and $ZCSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zcstatus) are different. You can SET the former, but the latter is read-only. https://docs.yottadb.com/MessageRecovery/errormsgref.html#zmessage-codes has a table of the error codes.

Regards
– Bhaskar

Re: How to capture ZLINK errors programatically?

<e88c046c-df3a-4f81-8ce0-78b0c2584c0bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=448&group=comp.lang.mumps#448

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:620a:688:b0:6bb:29aa:4ce4 with SMTP id f8-20020a05620a068800b006bb29aa4ce4mr4952666qkh.18.1660912635810;
Fri, 19 Aug 2022 05:37:15 -0700 (PDT)
X-Received: by 2002:a05:620a:408a:b0:6bb:58dc:1e66 with SMTP id
f10-20020a05620a408a00b006bb58dc1e66mr5167928qko.707.1660912635422; Fri, 19
Aug 2022 05:37:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Fri, 19 Aug 2022 05:37:15 -0700 (PDT)
In-Reply-To: <c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=173.164.29.153; posting-account=siWvwQoAAACYCGtn7kPrEYinJEra-Oc0
NNTP-Posting-Host: 173.164.29.153
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com> <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
<6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com> <c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e88c046c-df3a-4f81-8ce0-78b0c2584c0bn@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: kdtop3@gmail.com (kdtop)
Injection-Date: Fri, 19 Aug 2022 12:37:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3036
 by: kdtop - Fri, 19 Aug 2022 12:37 UTC

I tried to reproduce what I posted before and could not. Apparently the $ZSTATUS I posted was somehow left over from a prior execution. Here I show that $ZSTATUS is NOT set by ZLINK or ZCOMPILE.

This is consistent with what Bhaskar posted. Thanks for pointing me in the correct direction!

Kevin

yottadb>ZL "TMGTEST2"
SET X ^-----
At column 9, line 574, source module /opt/worldvista/EHR/p/TMGTEST2.m
%YDB-E-EXPR, Expression expected but not found
%YDB-E-LABELMISSING, Label referenced but not defined: TRPCDone
%YDB-I-SRCNAM, in source module /opt/worldvista/EHR/p/TMGTEST2.m

yottadb>W $ZSTATUS

yottadb>W 1
1 yottadb>ZCOMPILE "/opt/worldvista/EHR/p/TMGTEST2.m"
SET X ^-----
At column 9, line 574, source module /opt/worldvista/EHR/p/TMGTEST2.m
%YDB-E-EXPR, Expression expected but not found
%YDB-E-LABELMISSING, Label referenced but not defined: TRPCDone
%YDB-I-SRCNAM, in source module /opt/worldvista/EHR/p/TMGTEST2.m

yottadb>w $zstatus

yottadb>

On Thursday, August 18, 2022 at 10:58:50 AM UTC-4, K.S. Bhaskar wrote:
> > ...
> > > $ZCSTATUS (https://docs.yottadb.com/ProgrammersGuide/isv.html#zcstatus) captures the result of a ZCOMPILE. I don't know whether it captures the result of a ZLINK and I can't check right now, but in case it does not, you can always do ZCOMPILE before doing the ZLINK (which in any case only recompiles if necessary).
> > >
> > > Regards
> > > – Bhaskar
> > Bhaskar,
> >

> – Bhaskar

Re: How to capture ZLINK errors programatically?

<5df41851-1304-4b22-b110-cfd146f78c00n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=480&group=comp.lang.mumps#480

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:ae9:f109:0:b0:6fa:22fd:94ca with SMTP id k9-20020ae9f109000000b006fa22fd94camr1073662qkg.338.1668680768200;
Thu, 17 Nov 2022 02:26:08 -0800 (PST)
X-Received: by 2002:a05:622a:420b:b0:3a4:fb31:db9c with SMTP id
cp11-20020a05622a420b00b003a4fb31db9cmr1475356qtb.637.1668680768068; Thu, 17
Nov 2022 02:26:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 17 Nov 2022 02:26:07 -0800 (PST)
In-Reply-To: <e88c046c-df3a-4f81-8ce0-78b0c2584c0bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.128.175.27; posting-account=e6ZTGwoAAAD0RJ1tKSnsnYuh1JIHXrm6
NNTP-Posting-Host: 98.128.175.27
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com> <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
<6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com> <c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>
<e88c046c-df3a-4f81-8ce0-78b0c2584c0bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5df41851-1304-4b22-b110-cfd146f78c00n@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: jens.lidestrom@vgregion.se (Jens Lideström)
Injection-Date: Thu, 17 Nov 2022 10:26:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2102
 by: Jens Lideström - Thu, 17 Nov 2022 10:26 UTC

In our application run commands from remote servers in a separate process with this command:

s output=call("mumps -run ^%XCMD 'w "Hello!",!'")

We read the output from the command with a PIPE device like this:

call(command)
n (command)
s ret=""
s p="myProcSystemCall"_$job
o p:(shell="/bin/sh":command=command:READONLY)::"PIPE" u p
f r line q:$zeof s ret=ret_$s($l(ret):$c(10),1:"")_line
c p
q ret

This seems to work fine for zlink also. Just change the command 'w "Hello!"' above to call zlink instead.

BR,
Jens Lideström

Re: How to capture ZLINK errors programatically?

<c3940d7e-a4d8-4c92-bbf2-eef926472e5dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=481&group=comp.lang.mumps#481

  copy link   Newsgroups: comp.lang.mumps
X-Received: by 2002:a05:6214:188d:b0:4bc:1ece:e0b1 with SMTP id cx13-20020a056214188d00b004bc1ecee0b1mr3314397qvb.18.1668704989646;
Thu, 17 Nov 2022 09:09:49 -0800 (PST)
X-Received: by 2002:a0c:9024:0:b0:4bb:9dd2:d7a0 with SMTP id
o33-20020a0c9024000000b004bb9dd2d7a0mr3372136qvo.25.1668704989454; Thu, 17
Nov 2022 09:09:49 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.mumps
Date: Thu, 17 Nov 2022 09:09:49 -0800 (PST)
In-Reply-To: <5df41851-1304-4b22-b110-cfd146f78c00n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=71.162.243.192; posting-account=zTPg1AoAAABx_LtAQ3dW6FBnU1dwmSvl
NNTP-Posting-Host: 71.162.243.192
References: <dd2aaafb-7c57-4c1b-aa77-7e41d49e43a2n@googlegroups.com>
<5cb055e1-f5bc-48c9-8cff-913726df2248n@googlegroups.com> <a5bbba51-bb9a-4803-8867-2fe854cd9739n@googlegroups.com>
<6755c025-1954-4b6a-86dd-ce17a477fbbcn@googlegroups.com> <c8d3bda6-55a7-4bb7-aa66-f3e7b16e13d9n@googlegroups.com>
<e88c046c-df3a-4f81-8ce0-78b0c2584c0bn@googlegroups.com> <5df41851-1304-4b22-b110-cfd146f78c00n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c3940d7e-a4d8-4c92-bbf2-eef926472e5dn@googlegroups.com>
Subject: Re: How to capture ZLINK errors programatically?
From: ksbhaskar@gmail.com (K.S. Bhaskar)
Injection-Date: Thu, 17 Nov 2022 17:09:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2820
 by: K.S. Bhaskar - Thu, 17 Nov 2022 17:09 UTC

On Thursday, November 17, 2022 at 5:26:08 AM UTC-5, jens.li...@vgregion.se wrote:
> In our application run commands from remote servers in a separate process with this command:
>
> s output=call("mumps -run ^%XCMD 'w "Hello!",!'")
>
> We read the output from the command with a PIPE device like this:
>
> call(command)
> n (command)
> s ret=""
> s p="myProcSystemCall"_$job
> o p:(shell="/bin/sh":command=command:READONLY)::"PIPE" u p
> f r line q:$zeof s ret=ret_$s($l(ret):$c(10),1:"")_line
> c p
> q ret
>
> This seems to work fine for zlink also. Just change the command 'w "Hello!"' above to call zlink instead.
>
> BR,
> Jens Lideström

When I use PIPE devices, I tend to use the stderr deviceparameter to capture stderr of the pipe. For example:

YDB>o "c":(shell="/bin/sh":command="yottadb -noobject .yottadb/r/esvbug..m":stderr="e")::"pipe" u "c"

YDB>f r x q:$zeof u $p w x,! u "c"

YDB>u "e" f r x q:$zeof u $p w x,! u "e"
%YDB-E-FMLLSTMISSING, The formal list is absent from a label called with an actual list: lab2
%YDB-I-SRCNAM, in source module /home/bhaskar/.yottadb/r/esvbug.m

YDB>u $p c "c","e"

YDB>

Regards
– Bhaskar

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor