Hi everybody.
Products: Nat 4.2 Ada 7.x
I’m facing the following task:
To optimize a massive batch processing, different Natural PDAs, holding already processed data, should be temporarily stored in adabas. Thus adabas will act as a “cache”.
Additional requirements:
- The general usage of the PDAs should not be affected.
- RESET MYPDA should work (type specific initial values)
- MYPDA.NAME := ‘brian’ should work (so MYPDA must stay on Level 1)
- CALLNAT 'SUBPRG´ MYPDA should work as before
I started with the cache FDT:
PE 1 CACHE 80
2 BYTE-CONTAINER B 125
Giving a byte container of 10’000 bytes.
The user view is
1 CACHE-VIEW
2 BYTE-CONTAINER B 125 (1:80)
2 REDEFINE BYTE-CONTAINER
3 BYTE-CHUNK B10000
When it comes to the Natural PDAs it becomes tricky. The idea was to make some kind of redefine in order to code
CACHE-VIEW.BYTE-CHUNK := MYPDA.BYTES
As mentioned before, the usage of MYPDA should not be affected.
My first try was to redefine the Level 1 MYPDA. This causes a NAT 207.
Then I tried to do
1 MYPDA
2 BYTES B 1200
2 REDFEINE BYTES
3 NAME A30
3 BIRTHDAY D
This causes a RESET MYPDA to initialize all data with x’00’.
Then the version
1 MYPDA
2 BYTES B 1200
2 REDFEINE BYTES
3 MYPDA_STRUCT
4 NAME A30
4 BIRTHDAY D
Works, but all RESET Statements either explicit or implicit must be changed to RESET MYPDA.MYPDA_STRUCT.
To summarize it: I didn’t find a way in Natural to do it AND fulfill the above mentioned requirements.
What I really need is something like “memcpy” (or MVCL) to move a chunk of bytes.
My current strategy is to use the CALL INTERFACE4 and let a “C”-program do the job.
Are there any other hints to solve this task?
Thx for any suggestions
Christian