Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java Toolkit & RTV* CL commands

87 views
Skip to first unread message

Mr. K.V.B.L.

unread,
Oct 30, 2014, 10:31:27 AM10/30/14
to
Has anyone attempted one of these 'Command XXX not allowed in this setting.' commands like RTVSYSVAL with the Java Toolkit? The CommandCall class doesn't seem to support these types of commands. I'm still digging through the documentation, however. Thanks!

Danilo Cussini

unread,
Oct 30, 2014, 12:43:05 PM10/30/14
to
In stead of RTVSYSVAL command try Retrieve System Values (QWCRSVAL) API.

Mr. K.V.B.L.

unread,
Oct 30, 2014, 1:03:15 PM10/30/14
to
Thats fine but what about other RTV commands? I am actually trying to run a custome RTV command written by a third party.

CRPence

unread,
Oct 30, 2014, 1:17:25 PM10/30/14
to
That would be msg CPD0031, and as described by the specific
limitations for preclusion of use outside of a "REXX procedure", "CL
program", or "CL ILE program"; though when invoked via that class the
request is implicitly an effective "batch" process, any interactive vs
batch limitation that is alluded by that message is not germane.

Given the Retrieve commands require a CL [or REXX psuedo-CL]
variable, I do not see how that class would be able to invoke such
commands or otherwise effect the same results without a wrapper. And if
a wrapper is required, then there might already be a function available
specific to the task within the JT400, or a CLP could be created for
what is required; then the ProgramCall used instead, to enable
establishing parameter variables for return values.

AFaIK the Command Call class is effectively just enabling a command
string to be passed to the CL interpreter just as [and possibly
implemented with] a CALL QCMDEXC PARM(cmd_string cmd_length) [which
requires ability to run in the *EXEC environment].

--
Regards, Chuck

Dr.UgoGagliardelli

unread,
Oct 30, 2014, 2:48:11 PM10/30/14
to
RTV* command can run only by a clp program.
You'll not be able to execute such a command even via qcmdexec or via
other hll programs.
Usually RTV* commands have at least one parameter that accept a clp
variable as an argument, so the command processind program modifies
pointers. Java provrams cannot use pointers that refer to an address
space but the JVM one.
The Java toolbox provide a lot of classes that cal be used instead of
RTV* commands, e.g to retrieve a sysval you can use
com.ibm.as400.access.SystemValue class:

AS400 system = new AS400 (.....);

SystemValue sysVal = new SystemValue(system, "QSRLNBR");
String serialNumber = sysVal.getValue().toString();

eventually sysval.getValue() will return different types for each
sysval, to test which type you can use sysval.getType() that returns an
integer constant for any possible type, javadoc says:

TYPE_ARRAY - this system value is a String[] object.
TYPE_DATE - this system value is a Date object.
TYPE_DECIMAL - this system value is a BigDecimal object.
TYPE_INTEGER - this system value is an Integer object.
TYPE_STRING - this system value is a String object.


Danilo Cussini

unread,
Oct 31, 2014, 5:24:22 AM10/31/14
to
Il giorno giovedì 30 ottobre 2014 18:03:15 UTC+1, Mr. K.V.B.L. ha scritto:
> Thats fine but what about other RTV commands? I am actually trying to run a
> custome RTV command written by a third party.

Probably you need to contact the software vendor and ask for a solution.
0 new messages