View Full Version : User Space - Retrieve Header Infor
01-01-1995, 02:00 AM
Assuming that the User Space was filled in by a List API then your code example should be working fine. Are you sure that the User Space was written to by a system List API (as opposed to some application program)?
01-27-1999, 08:53 AM
The QUSCHGUS API writes to the User Space only the data that you specify in the Input data parameter, and only to the location you specify in the Starting position parameter. The API does not automatically write any type of header information. So if the User Space is being written to only by QUSCHGUS within your application then there would be no generic header. There is no API "clear" function for User Spaces if what you are looking for is to reset all the bytes to x'00' or somesuch. You could accomplish such as reset via QUSCHGUS and writing x'00's yourself. If what you really want is to truncate the space allocated for the User Space, then this can be done with the Change User Space Attributes (QUSCUSAT) API and Key 1. When you want to re-use a User Space (for instance to re-run a given List API) you do not have to delete and recreate. Simply call the List API giving it the name of the previously used User Space. The API will then write over the previous values. The one consideration in doing this is that the List API will not truncate the User Space allocation if the second listing is smaller than the first listing, so some space waste may occur. The List API will however automatically extend the User Space if the second listing is larger than the first listing.
01-27-1999, 10:06 AM
Sounds like a winner to me. To play it safe you may want however to write out additional header information such as API/SRVPGM used, format name, date and time created, etc. As User Spaces are persistant (one may be out there for years) the additional header information may be of use down the road when you're trying to figure out what in the world a given User Space is being used for and where it came from.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.