Hello NONMEM73 Users,
I try to use call random:
$PK
IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
It does not matter how I try to code it, I am receiving the same error message:
372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
What is wrong with with it?
Thank you,
Pavel
call random: 372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
6 messages
4 people
Latest: Mar 27, 2014
Pavel,
The solution is to assign R to another variable. I've also re-structured your code to make things clearer (IMHO).
$PK
IF (ICALL.EQ.4) THEN ; only one ICALL.EQ.4 block is needed
IF (NEWIND.NE.2) THEN
CALL RANDOM(2,R)
UNUM=R ; save R value in a new variable
ENDIF
IF (UNUM.LE.0.1855) THEN ; only 1 logical test is required
HM=1
ELSE
HM=0
ENDIF
ENDIF
Quoted reply history
On 27/03/2014 11:23 a.m., Pavel Belo wrote:
> Hello NONMEM73 Users,
> I try to use call random:
> $PK
> IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
> IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
> IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
>
> It does not matter how I try to code it, I am receiving the same error message:
>
> 372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
> What is wrong with with it?
> Thank you,
> Pavel
Thank you Nick.
It does not work. The error message is the same. It is strange. It almost looks like a bag or an installation issue. I tried it on different computers.
Quoted reply history
On Wed, Mar 26, 2014 at 06:33 PM, Nick Holford wrote:
Pavel,
The solution is to assign R to another variable. I've also re-structured your code to make things clearer (IMHO).
$PK
IF (ICALL.EQ.4) THEN ; only one ICALL.EQ.4 block is needed
IF (NEWIND.NE.2) THEN
CALL RANDOM(2,R)
UNUM=R ; save R value in a new variable
ENDIF
IF (UNUM.LE.0.1855) THEN ; only 1 logical test is required
HM=1
ELSE
HM=0
ENDIF
ENDIF
On 27/03/2014 11:23 a.m., Pavel Belo wrote:
Hello NONMEM73 Users,
I try to use call random:
$PK
IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
It does not matter how I try to code it, I am receiving the same error message:
372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
What is wrong with with it?
Thank you,
Pavel
Pavel,
You must be doing something else that is strange.
What are you using for $SIM?
Here is a working control stream. It doesn't do anything with the random variable but it does run.
$PROB IV and Oral dose
$DATA ivpo20.csv
$INPUT ID TIME AMT CMT DV
$SIM (1234) (5678 UNIFORM) ONLYSIM NSUB=1
$THETA
(0,3,) ; POP_CL
(0,10,) ; POP_VD
(0,1,) ; POP_KA
(0,1,) ; POP_F
$OMEGA
0.09 ; PPV_CL
0.09 ; PPV_V
0.09 ; PPV_KA
0.25 ; PPV_F
$SIGMA
0.01 ; RUV_CV
1 ; RUV_SD
$SUBR ADVAN2 TRANS2
$PK
IF (ICALL.EQ.4) THEN ; only one ICALL.EQ.4 block is needed
IF (NEWIND.NE.2) THEN
CALL RANDOM(2,R)
UNUM=R ; save R value in a new variable
ENDIF
IF (UNUM.LE.0.1855) THEN ; only 1 logical test is required
HM=1
ELSE
HM=0
ENDIF
ENDIF
CL=THETA(1)*EXP(ETA(1))
V=THETA(2)*EXP(ETA(2))
KA=THETA(3)*EXP(ETA(3))
F1=THETA(4)*EXP(ETA(4))
S2=V
$ERROR
Y = F*(1+EPS(1)) + EPS(2)
$TABLE ID TIME CL V KA F1 Y
NOPRINT ONEHEADER FILE=ivpo.fit
Quoted reply history
On 27/03/2014 1:23 p.m., Pavel Belo wrote:
> Thank you Nick.
>
> It does not work. The error message is the same. It is strange. It almost looks like a bag or an installation issue. I tried it on different computers.
>
> On Wed, Mar 26, 2014 at 06:33 PM, Nick Holford wrote:
>
> Pavel,
> The solution is to assign R to another variable. I've also
> re-structured your code to make things clearer (IMHO).
>
> $PK
> IF (ICALL.EQ.4) THEN ; only one ICALL.EQ.4 block is needed
> IF (NEWIND.NE.2) THEN
> CALL RANDOM(2,R)
> UNUM=R ; save R value in a new variable
> ENDIF
> IF (UNUM.LE.0.1855) THEN ; only 1 logical test is required
> HM=1
> ELSE
> HM=0
> ENDIF
> ENDIF
>
> On 27/03/2014 11:23 a.m., Pavel Belo wrote:
> Hello NONMEM73 Users,
> I try to use call random:
> $PK
> IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
> IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
> IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
> It does not matter how I try to code it, I am receiving the same
> error message:
> 372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
> What is wrong with with it?
> Thank you,
> Pavel
Hi Pavel,
Perhaps try a variable name other than "R". The error suggest that it is a
reserved name that cannot be reused.
Thanks,
Bill
Quoted reply history
On Mar 26, 2014, at 18:52, "Pavel Belo"
<[email protected]<mailto:[email protected]>> wrote:
Hello NONMEM73 Users,
I try to use call random:
$PK
IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
It does not matter how I try to code it, I am receiving the same error message:
372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
What is wrong with with it?
Thank you,
Pavel
Pavel, glad to know you solved the problem.
The variable name R1 is probably safe enough to use in your control
stream, but could be problematic
if you wanted to model infusion rate into compartment 1.
R1 would be a reserved variable in $PK:
$PK
R1=...
Now there might be a conflict with use of R1 in the other block.
I suggest a variable name such as RR that is never reserved under any
circumstances.
- Alison
Quoted reply history
On Thu, Mar 27, 2014, at 06:50 AM, Pavel Belo wrote:
Hello Allison,
Yes, it is solved. There was another R variable used for
approximation of normal probability densith in another block. I
calledit R1 and it was resolved. Silly.... I spent 1.5 hours
massaging this code.
Thanks!
Pavel
On Thu, Mar 27, 2014 at 08:57 AM, Alison Boeckmann wrote:
Pavel, have you solved your problem yet?
The only way I can reproduce this error message is to use R on the left
in another block (such as $ERROR or $DES)
prior to its appearance in the $PK block. This causes R to be listed
in NMPRD4, which gives rise to the error message.
Can you send me your complete control stream?
On Wed, Mar 26, 2014, at 05:23 PM, Pavel Belo wrote:
Thank you Nick.
It does not work. The error message is the same. It is strange. It
almost looks like a bag or an installation issue. I tried it on
different computers.
On Wed, Mar 26, 2014 at 06:33 PM, Nick Holford wrote:
Pavel,
The solution is to assign R to another variable. I've also
re-structured your code to make things clearer (IMHO).
$PK
IF (ICALL.EQ.4) THEN ; only one ICALL.EQ.4 block is needed
IF (NEWIND.NE.2) THEN
CALL RANDOM(2,R)
UNUM=R ; save R value in a new variable
ENDIF
IF (UNUM.LE.0.1855) THEN ; only 1 logical test is required
HM=1
ELSE
HM=0
ENDIF
ENDIF
On 27/03/2014 11:23 a.m., Pavel Belo wrote:
Hello NONMEM73 Users,
I try to use call random:
$PK
IF (ICALL.EQ.4.AND.NEWIND.NE.2) CALL RANDOM(2,R)
IF (ICALL.EQ.4.AND.R.LE.0.1855) HM=1
IF (ICALL.EQ.4.AND.R.GT.0.1855) HM=0
It does not matter how I try to code it, I am receiving the same error
message:
372 "R" IN CALL RANDOM MAY NOT BE USED GLOBALLY IN ANOTHER BLOCK.
What is wrong with with it?
Thank you,
Pavel
--
Alison Boeckmann
[1][email protected]
References
1. mailto:[email protected]
--
Alison Boeckmann
[email protected]