You have this:
If %Parms <= 2;
Clear Key1;
Clear Key2;
Endif;
Which is clearly wrong.
You should have this:
If %Parms >= 3;
Clear Key1;
If %Parms >= 4
Clear Key2;
Endif;
Endif;
-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Johan Vangilbergen
Sent: Thursday, April 05, 2007 8:19 AM
To: RPG programming on the AS400 / iSeries
Subject:
I am puzzled !
I'm calling a subprocedure. This subprocedure has 4 parameters in its
procedure interface. Only the first is required, the three others have
the option *NOPASS.
D Patientadmit PI N
D Cazi Like(CaziDp) Const
D Date D Const Options(*Nopass)
D Key1 Like(Key1Dp) Const
Options(*Nopass)
D Key2 Like(Key2Dp) Const
Options(*Nopass)
D Datu S 8 0
/Free
If %Parms <= 2;
Clear Key1;
Clear Key2;
Endif;
If %Parms = 1;
Datu = %Int(%Char(%Date():*Iso0));
Else;
Datu = %Int(%Char(Date:*Iso0));
Endif ;
I'm calling this subprocedure in the following way :
C If PatientAdmit(CaziHo:%Date(DateHo:*Iso))
C ... Do some stuff
C EndIf
When I run this interactively, all goes well. However, if I run this in
batch, the procedure crashes on the "Clear Key2" statement, saying that
the pointer or location was not referenced.
What am I missing ?
Maybe, I have to say that the subprocedure is part of a service program
which is bound to the calling program.
Johan Vangilbergen
YUSE
Phone : +32 16 74 50 80
Fax : +32 16 74 50 89
Email : jvg@xxxxxxx <
mailto:jvg@xxxxxxx>
Web : WWW.Yuse.be <
http://www.Yuse.be>
Address : Bondgenotenlaan 138, B-3000 Leuven, Belgium
As an Amazon Associate we earn from qualifying purchases.