View Full Version : User Space Creation
Guest.Visitor
01-01-1995, 02:00 AM
When I tried to create a User Space, through a CL Program , just by giving a call to the API QUSCRTUS, I am not able to control the size of the User Space. The IBM API reference manual says that the Length parameter should be BINARY(4). In CL, how should we tackle this situation?. I also tried to make an RPG/400 program to do the same task which also went in vein. Can any body please expalin me how to declare this length parameter and how can we create one with length I specify... thanks in advance..
G.Gaunt
07-26-1999, 06:08 AM
Here are a couple of ways to pass a BIN(4) from CL. <pre> DCL &SIZE *CHAR 4 CHGVAR %BIN(&SIZE 1 4) 512 CALL QUSCRTUS PARM( ..... &SIZE ..... ) /* or */ CALL QUSCRTUS PARM( ..... X'00000200' ..... ) </pre>
Guest.Visitor
07-28-1999, 08:29 AM
Thank you Gaunt for your reply. I could create a user space successfully and also was able to convert the variable to binary. Now my problem is I am not able to control the length correctly. When used various length as input to the program, it created user sapce with size slightly different from what i gave as input. Following is my observation.. The input variable was 10 long and I was using %BIN(&var 1 4). This varaible was used as length parameter for the API QUSCRTUS to create the User sapce. Length variable value Size of the User sapce created. 0000001000 4096 Bytes 0000000100 4096 0000001111 4096 0000011111 12288 0000021111 24576 0000030000 32768 0000040000 40960 0000050000 53248 0000060000 61440 0000061000 65536 0000061100 65536 0000070000 73728 0000080000 81920 0000090000 94208 0000100000 102400 0000110000 110592 How is the process of converting a character in to binary works. is it ordinary Decimal to Binary conversion moethod or is there any other procedure involved in this? Is there any minimum size for the user space? Please throw some light on these.. thank You cham Silvy J.
Guest.Visitor
07-28-1999, 08:31 AM
G.Gaunt
07-28-1999, 09:12 AM
Cham, your arithmetic is okay. I think what you are observing is a feature of QUSCRTUS: it rounds your size up to a 256-byte boundary.
Guest.Visitor
08-23-1999, 01:23 PM
Cham, The sizes you list look like the object size. You should retrieve the size using the get space attributes API after you create it. The actual internal size will always be at least as large as what you specify. Through observation I have found the object size to be the requested size + 512 rounded up to the nearest 4k boundary. David Morris
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.