For the *DTS Date fields I was able to get working by defining as byte
fields. I was unable to get working when defined in PCML as Character
fields. The documentation defines as character, will I have a problem
defining as bytes ???
I extract the field using the method getValue (to type of Object).
PCML
<!-- next field is RESERVED: -->
<data type="byte" length="1"
usage="output"/>
<data name="signOnInvalid" type="int" length="4"
usage="output"/>
<data name="status" type="char" length="10"
usage="output"/>
<data name="passChgDate" type="byte" length="8"
usage="output"/> <=====Date is byte
<data name="noPassInd" type="char" length="1"
usage="output"/>
<!-- next field is RESERVED: -->
<data type="byte" length="1"
usage="output"/>
<data name="passExpInterval" type="int" length="4"
usage="output"/>
<data name="datePassExp" type="byte" length="8"
usage="output"/> <=====Date is byte
JAVA:
// These Two Dates are defined in the PCML as BYTE type (and not
Character)
// Password CHANGE date
byte[] chgDatePass =
(byte[])pcml.getValue("qsyrusri.receiver.passChgDate");
d = conv.convert(chgDatePass, "*DTS");
System.out.println(" Password CHANGE Date: " + d);
// Password EXPIRE date
byte[] expDatePass =
(byte[])pcml.getValue("qsyrusri.receiver.datePassExp");
d = conv.convert(expDatePass, "*DTS");
System.out.println(" Password EXPIRE Date: " + d);
Also, I could not retrieve the Home Directory Name ('dirname', below).
This is defined as variable length field; defined length with structure
field 'homedirbytes (see below):
<!-- Home Directory Structure -->
<struct name="homeDir" offset="offsetHomeDir">
<data name="ccsid" type="int" length="4"
usage="output"/>
<data name="cntryid" type="char" length="2"
usage="output"/>
<data name="langid" type="char" length="3"
usage="output"/>
<data type="byte" length="3"
usage="output"/>
<data name="flags" type="int" length="4"
usage="output"/>
<data name="homedirbytes" type="int" length="4"
usage="output"/>
<data name="delimiter" type="char" length="2"
usage="output"/>
<data type="byte" length="10"
usage="output"/>
<data name="dirname" type="char"
length="homedirbytes" usage="output"/>
</struct>
-----Original Message-----
From: java400-l-admin@midrange.com [mailto:java400-l-admin@midrange.com]
On Behalf Of Dave Wall
Sent: Thursday, December 06, 2001 6:19 PM
To: java400-l@midrange.com
Subject: Re: Java 400 - QSYRUSRI API call
The character 8 field is the date in an iSeries date-time stamp (*DTS)
format. The iSeries has an API to convert it from this format to a more
industry-standard type format. Toolbox needed to do this conversion so
often that we wrapped the API call in a class ...
byte[] data = ...; // Some Char 8 *DTS date data from the system.
DateTimeConverter conv = new DateTimeConverter(system_); // system_
is an AS400 object
Date d = conv.convert(data, "*DTS");
If you use this class make sure you give it the raw bytes from the
original API call. Don't convert them from EBCDIC to Unicode before
giving them to DateTimeConverter.
David Wall
AS/400 Toolbox for Java
"Craig Burton"
<Craig.Burton@ccba To:
<java400-l@midrange.com>
i.com> cc:
Sent by: Subject: Java 400 -
QSYRUSRI API call
java400-l-admin@mi
drange.com
12/06/2001 10:32
AM
Please respond to
java400-l
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
When calling QSYRUSRI in Java (format USRI0300) how are the dates
(specifically Password Change Date) retrieved. One example has this
field defined as Character 8, another example has as Byte 8. When I use
the metho getValue to a field of type Object, the field is displayed as
barbled.
Does anyone have an example of retrieving USRI0300 utilizing Java ????
Craig Burton
CCB Associates Inc.
Lawrence, Ma.
(9768) 837-4403 x22
--
_______________________________________________
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
_______________________________________________
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.