ca.portal.admin

Re:Get storage

Discussion created by ca.portal.admin on Jul 22, 2009
Thanks to Tommy's and Peter's suggestion, I am now getting a clean
compile. But I don't seem to be getting a valid pointer back at run
time. Can anyone provide a way to convert the pointer to a displayable
format? Or better yet, some sample code that uses the pointer parameter
for ""get scratch""?

I wish the storage interface had separate ""get"" and ""put"" commands, like
the scratch and queue interfaces do. I am having some difficulty
determining which parameters apply to which situation.
"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: Get storage
"Below is an example of a GET STORAGE that works for me - note the following:

1) Instead of a LENGTH I specify the first and last fields of a data area in the LINKAGE SECTION of my program (from xxxx to yyyy)

2) I have specified SHARED and KEEP which means that I can share the named storage area (STGID) between tasks and between terminals - it is in effect a ""system storage"" control block in this case - if the storage is just being passed from task to task at the same terminal DO NOT use SHARED

3) This is an AUTOSTATUS environment - DB-STATUS-OK is of course allowed through - as is DC-NEW-STORAGE which handles RC=4 which says that you got your storage but it had not previously been allocated - the ""value LOW-VALUE"" clause only applies to the DC-NEW-STORAGE condition

4) Note that of the storage is new (DC-NEW-STORAGE) I use the Cobol ""set"" verb to save the address of the new storage

5) In most situations you should not need to ""set pointer-value-type to ADDRESS of storage-area"" or use the pointer-value-type data item later on - this should only be required if you are building a ""system styled"", user control block structure.

6) I hope this helps - feel free to contact me if you have any further questions - cheers - Gary

get STORAGE FOR DB50-STORAGE
to DB50-END
WAIT
KEEP LONG SHARED STGID 'ENS$'
value LOW-VALUE
ON DC-NEW-STORAGE
set JCR-ENS-POINTER to ADDRESS of DB50-STORAGE
end-if

set JCR-POINTER to JCR-ENS-POINTER

7) Note - because of the ""KEEP"" this storage could hang around for a long time - to do the cleanup to get rid of it just dTo:
free STORAGE STGID 'ENS$' <---- complements the example get STORAGE above

Cheers - Gary


Gary Cherlet
Justice Technology Services
Department of Justice, SA Government
Telephone +61 (0)8 8226 5199
Facsimile +61 (0)8 8226 5311
Mobile +61 (0)41 333 1613
MailTo:gary.cherlet@sa.gov.au from August 1st

This e-mail message and any attachments are qualified as follows: Addressing: If you have received this e-mail in error, please advise by reply e-mail to the sender. Please also destroy the original transmission and its contents. Confidentiality: This e-mail may contain confidential information which also may be legally privileged. Only the intended recipient(s) may access, use, distribute or copy this e-mail. Individual Views: Unless otherwise indicated, the views expressed are those of the sender, not Justice Technology Services. Computer Viruses: It is the recipient's responsibility to check the e-mail and any attached files for viruses.

Outcomes