× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am trying to rewrite the command RSTSPLF from April 2006 iSeries Network into RPGLE. It was originally written in CLLE and I keep getting pointer errors and something like this should be written in RPGLE.

My problem is that I am getting junk on the Spool File Attribute parameter for the date times.

Here is partial command source definition.

PARM KWD(SPLFATR) TYPE(E2) MIN(0) MAX(1) +
PMTCTL(SPLFATR) PROMPT('Spooled file +
attributes')

Q3: QUAL TYPE(*GENERIC) LEN(10) DFT(*ALL) +
SPCVAL((*ALL)) PASSATR(*NO)
QUAL TYPE(*GENERIC) LEN(10) DFT(*ALL) +
SPCVAL((*ALL) (*CURLIB) (*LIBL)) +
PASSATR(*NO) PROMPT('Library')

E2: ELEM TYPE(Q3) RSTD(*NO) MIN(0) EXPR(*NO) +
PASSATR(*NO) PROMPT('Output queue')
ELEM TYPE(*GENERIC) LEN(10) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('Spooled file name')
ELEM TYPE(*GENERIC) LEN(10) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('Job name')
ELEM TYPE(*GENERIC) LEN(10) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('User name')
ELEM TYPE(*CHAR) LEN(6) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('Job number')
ELEM TYPE(*CHAR) LEN(10) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('User specified data')
ELEM TYPE(*GENERIC) LEN(8) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL) (*CURRENT)) MIN(0) +
EXPR(*YES) PASSATR(*NO) PROMPT('Job +
system name')
ELEM TYPE(*CHAR) LEN(10) RSTD(*NO) DFT(*ALL) +
SPCVAL((*ALL) (*STD)) MIN(0) EXPR(*YES) +
PASSATR(*NO) PROMPT('Form type')
ELEM TYPE(E3) RSTD(*NO) DFT(*ALL) SNGVAL((*ALL +
0000000)) MIN(0) PASSATR(*NO) +
PROMPT('Starting create date and time')
ELEM TYPE(E3) RSTD(*NO) DFT(*ALL) SNGVAL((*ALL +
0000000)) MIN(0) PASSATR(*NO) +
PROMPT('Ending create date and time')

E3: ELEM TYPE(*DATE) MIN(1) MAX(1) EXPR(*YES) +
PROMPT(' Create date')
ELEM TYPE(*TIME) MIN(1) MAX(1) EXPR(*YES) +
PROMPT(' Create time')


I have defined my data structure in RPG to be.

d TD_QualifiedName...
d ds Qualified
d Name...
d Like(StdNam)
d Library...
d Like(StdNam)

d TD_DateTime...
d ds Qualified
d ElementSize...
d Like(StdIntSml)
d Date...
d 7a
d Time...
d 6a

d TD_SpoolAttribute...
d ds Qualified
d ElementSize...
d Like(StdIntSml)
d OutputQueue...
d LikeDs(TD_QualifiedName)
d SpoolFileName...
d Like(StdNam)
d JobName...
d Like(StdNam)
d UserName...
d Like(StdNam)
d JobNumber...
d Like(StdJobNum)
d UserSpecifiedData...
d Like(StdNam)
d SystemName...
d 8a
d FormType...
d Like(StdNam)
d StartDateTime...
d LikeDs(TD_DateTime)
d EndDateTime...
d LikeDs(TD_DateTime)

Now everything is fine except for the Start and End Date Time fields.

I get something like this. The element size is screwee and there is 4-bytes of garbage and the starting and ending dates are reversed.

Is there something I don't understand about the command definition? Shouldn't each element start with a two byte length followed a 7-byte date and 6-byte time?

I think I have a bug in the command language but wanted to ask people is they saw a problem before I called IBM.

INSPOOLFILEATTRIBUTE.STARTDATETIME.ELEMENTSIZE = 105
INSPOOLFILEATTRIBUTE.STARTDATETIME.DATE = ' ! 107'
INSPOOLFILEATTRIBUTE.STARTDATETIME.TIME = '121823'
INSPOOLFILEATTRIBUTE.ENDDATETIME.ELEMENTSIZE = -2567
INSPOOLFILEATTRIBUTE.ENDDATETIME.DATE = '59 107'
INSPOOLFILEATTRIBUTE.ENDDATETIME.TIME = '121701'

Hex version:

000A5CC1 D3D34040 40404040 5CC1D3D3 - ..*ALL *ALL
40404040 40405CC1 D3D34040 40404040 - *ALL
5CC1D3D3 40404040 40405CC1 D3D34040 - *ALL *ALL
40404040 5CC1D3D3 40405CC1 D3D34040 - *ALL *ALL
40404040 5CC1D3D3 40404040 5CC1D3D3 - *ALL *ALL
40404040 40400069 005A0002 F1F0F7F1 - .Ñ.!..1071
F2F1F8F2 F3F5F9F5 F90002F1 F0F7F1F2 - 218235959..10712
F1F7F0F1 ........ ........ ........ - 1701............

The input looks like this

Spooled file attributes:
Output queue . . . . . . . . . > *ALL Name, generic*, *ALL
Library . . . . . . . . . . *ALL Name, generic*, *ALL...
Spooled file name . . . . . . > *ALL Name, generic*, *ALL
Job name . . . . . . . . . . . > *ALL Name, generic*, *ALL
User name . . . . . . . . . . > *ALL Name, generic*, *ALL
Job number . . . . . . . . . . > *ALL Character value, *ALL
User specified data . . . . . > *ALL Character value, *ALL
Job system name . . . . . . . > *ALL Name, generic*, *ALL...
Form type . . . . . . . . . . > *ALL Character value, *ALL, *STD
Starting create date and time:
Create date . . . . . . . . > '12/17/2007' Date, *ALL
Create time . . . . . . . . > '01:01:01' Time
Ending create date and time:
Create date . . . . . . . . > '12/18/2007' Date, *ALL
Create time . . . . . . . . > '23:59:59' Time

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.