× 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.



This corresponds to what I said in my first post: Simply resolving a pointer to an object does not cause the last used date to be updated. It also corresponds to what I said in the first bullet point in my second post.

However, the statement that you quoted from the manual regarding using the Change User Space API to update the object usage information appears to be incorrect.

I created a user space with an initial length of 1024 and wrote the following CL program. Use of the QUSCHGUS API did not update the usage information. It didn't matter if the last parameter on the call to QUSCHGUS was a value of '0', '1', or '2'. This was on 6.1. A similar program to use the QUSRTVUS API to read the contents of the user space did cause the usage information to be updated.

Pgm (&UsrSpcFull)
Dcl &UsrSpcFull *Char 20
Dcl &UsrSpcName *Char 10 Stg(*Defined) DefVar(&UsrSpcFull 1)
Dcl &UsrSpcLib *Char 10 Stg(*Defined) DefVar(&UsrSpcFull 11)

Dcl &LocalVar *Char 30
Dcl &Text *Char 52
Dcl &UseDate *Char 7

CallSubr GetUseDate /* check used date */
ChgVar &LocalVar 'Here''s some data'
Call QUSCHGUS (&UsrSpcFull x'00000001' x'0000001E' &LocalVar '2')
CallSubr GetUseDate /* check used date */

/* ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((() */
Subr GetUseDate
/* ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((() */

RtvObjD &UsrSpcLib/&UsrSpcName *USRSPC UseDate(&UseDate)
If (&UseDate = ' ') (ChgVar &UseDate 'blank')
ChgVar &Text ('Last used date for' |> &UsrSpcLib |< '/' || &UsrSpcName +
|> 'is' |> &UseDate |< '.')
Call QUILNGTX (&Text x'00000034' ' ' ' ' x'0000000000000000')

EndSubr

EndPgm: EndPgm

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Bruce Vining
Sent: Friday, November 02, 2012 05:32
To: Midrange Systems Technical Discussion
Subject: Re: Object use vs. library use

The QUSPTRUS documentation, at
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qusptrus.htm,
has this to say:


"Use of the QUSPTRUS API does not update the object usage information (such as last changed date, last date used, and so on). You should use the Change User Space or the Retrieve User Space API to update the object usage information if needed."

Bruce Vining
On Fri, Nov 2, 2012 at 3:20 AM, Robert Houts <rshouts@xxxxxxxxx> wrote:

Ken,

I did some testing and discovered the following for user spaces:

-- If you obtain a space pointer via the QUSPTRUS API or resolve the
system pointer and then set a space pointer from that system pointer
and then directly read data from the user space or write data to the
user space, the usage information is NOT updated.
-- If you use the QUSRTVUS API to read data from the user space, the
usage information IS updated.
-- If you use the QUSCHGUS API to change data in the user space, the
usage information is NOT updated.

So, the last one, changing the user space via the API, behaves just
like the CHGDTAARA command; it doesn't update the usage information.

You should notice that in IBM's usage documentation that user spaces
aren't mentioned.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Ken Sims
Sent: Thursday, November 01, 2012 07:26
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Object use vs. library use

Hi Robert -

On Thu, 1 Nov 2012 09:29:06 +0000, Robert Houts <rshouts@xxxxxxxxx>
wrote:

Simply resolving a pointer to an object does not cause the last used
date
to be updated. For example, the RTVDTAARA command and QWCRDTAA API
both cause the last used date of a data area to be updated. But,
(inexplicably) the CHGDTAARA command does not. In all three cases the
pointer is resolved. You can resolve pointers all day long to any
objects, but the usage information is only updated when you actually use the object.

The last used date for a program is updated when a program is run (or
activated). As with all objects whose usage information is tracked,
it is only updated the first time it is used in a given day. It has
nothing to do with whether the calling program has been running for
several days or just a few microseconds. If a program that runs for
multiple days calls another program each of those days, the called
program's usage information will be updated each day that it is called.

So for something like a user space that is being read and/or updated
by use of a pointer (rather than the user space APIs), at what point
does the system update the last-used date?

Ken
Opinions expressed are my own and do not necessarily represent the
views of my employer or anyone in their right mind.

--
Regards,
Bruce
www.brucevining.com
www.powercl.com
--



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.