John Poulakos
Active User
Joined: 13 Jun 2012 Posts: 178 Location: United States
|
|
|
|
I do not have a problem, I am just looking to insure a storage technique I am using will not cause problems. I think it is OK, but it doesn't hurt to ask.
I use CICS containers for web services (provider and client). I do not know how many rows my web service providers will return in a response, as that is determined by DB2 cursors. It could be 1, 2, 100, etc. The version of CICS/TS I am using does not support appending containers, so I must acquire the memory for the containers before starting to fill them.
As I said, I don't know how many rows I will actually need, but I do know how many rows the web service client can reasonably handle without choking the server. So, I define the maximum number of occurrences I think it can handle using an occurs clause:
Code: |
01 SciStatResponse.
05 SciCompletion PIC X(32).
05 SciArray-num PIC S9(9) COMP-5 SYNC.
05 SciArray-cont PIC X(16).
01 SciArray-Hdr.
05 SciArray occurs 99.
10 ResType PIC X(4).
10 ResBatch PIC X(4).
10 ResDocId PIC X(12).
10 ResMessID PIC X(5).
10 ResMessTxt PIC X(36).
10 ResDate PIC X(24).
10 ResExpire PIC Z(4). |
I then compute the length I actually need to send where XX = the actual number of occurrences used:
Code: |
COMPUTE OutMem = (Length of SciArray * XX).
MOVE XX TO SciArray-num.
EXEC CICS
PUT CONTAINER('SCISTAT2001')
FROM (SciArray-Hdr)
FLENGTH(OutMem)
END-EXEC. |
My only concern with this approach is I want to make sure CICS releases all of the memory I defined. I don't see why it wouldn't, but it doesn't hurt to check. |
|