Code: |
05 t-idam-tbl. 10 t-idam-rader occurs 15000 ascending key is t-idam-wdws-uid indexed by x-wdws ascending key is t-idam-cics-uid indexed by x-cics. 15 t-idam-wdws-uid pic x(8). 15 t-idam-fornamn pic x(15). 15 t-idam-efternamn pic x(20). 15 t-idam-chef-uid pic x(8). 15 t-idam-cics-uid pic x(5). 15 t-vsg-behorighet pic x. 15 t-smort-behorighet pic xx. |
Code: |
ascending key is t-idam-cics-uid indexed by x-cics. |
Code: |
05 t-cics-tbl redefines t-idam-tbl. 10 t-cics-rader occurs 15000 ascending key is t-cics-uid indexed by x-cics. 15 filler pic x(51). 15 t-cics-uid pic x(5). 15 filler pic x(3). |
misi01 wrote: | ||
I'm guessing that the following isn't allowed (I certainly can't get it to compile)
What I would like to do is to define TWO diffferent keys for the same table. The first time through, I sort the table on ascending windows userid after which I can do a SEARCH ALL using the windows userid. Once I've done that, I then sort on ascending CICS userid and do a search all based on that field. |
Code: |
01 T-IDAM-TBL. 10 T-IDAM-RADER OCCURS 15000 ASCENDING KEY IS T-IDAM-WDWS-UID ASCENDING KEY IS T-IDAM-CICS-UID INDEXED BY X-WDS-CICS. 15 T-IDAM-WDWS-UID PIC X(8). 15 T-IDAM-FORNAMN PIC X(15). 15 T-IDAM-EFTERNAMN PIC X(20). 15 T-IDAM-CHEF-UID PIC X(8). 15 T-IDAM-CICS-UID PIC X(5). 15 T-VSG-BEHORIGHET PIC X. 15 T-SMORT-BEHORIGHET PIC XX. |
Quote: |
A. Z B. Y C. X |
misi01 wrote: |
Maybe I explained myself badly here. I don't want the table sorted on Windows and WITHIN that, on cics, I want it sorted on the one hand on Windows, and a completely different sort based on cics. Based on that, does your suggestion still fly? |
Code: |
01 T-IDAM-TBL. 05 T-IDAM-RADER OCCURS 15000 ASCENDING KEY IS T-IDAM-UID INDEXED BY X-WDS-CICS. 10 T-IDAM-UID PIC X(8). 10 T-IDAM-FORNAMN PIC X(15). 10 T-IDAM-EFTERNAMN PIC X(20). 10 T-IDAM-CHEF-UID PIC X(8). 10 T-VSG-BEHORIGHET PIC X. 10 T-SMORT-BEHORIGHET PIC XX. |
Code: |
01 T-IDAM-TBL. 05 T-IDAM-RADER OCCURS 15000 ASCENDING KEY IS T-WDWS-UID INDEXED BY X-WDWS. 10 T-WDWS-UID PIC X(8). 10 T-CICS-UID PIC X(5). |
Code: |
05 t-idam-tbl. 10 t-idam-rader occurs 10 ascending key is t-wdws-uid indexed by x-wdws ascending key is t-cics-uid indexed by x-cics. 15 t-wdws-uid pic x(8). 15 t-cics-uid pic x(5). |
Code: |
ascending key is t-cics-uid indexed by x-cics. |
Code: |
***************************************************************** * ***************************************************************** aha-find-cics-userid section. * search all t-idam-rader * at end set v-hittat-nej to true * when t-cics-uid(x-wdws) = w-cics-userid * Found it set v-hittat-ja to true end-search * exit. |
Code: |
05 t-wdws-tbl. 10 t-wdws-rader occurs 10 ascending key is t-wdws-uid indexed by x-wdws. 15 t-wdws-uid pic x(8). 15 t-cics-uid pic x(6). 05 t-cics-tbl. 10 t-cics-rader occurs 10 ascending key is t-cics indexed by x-cics. 15 t-wdws pic x(8). 15 t-cics pic x(6). |
Code: |
* move 'WDWS10' to t-wdws-uid(1) move 'CICS01' to t-cics-uid(1) * move 'WDWS09' to t-wdws-uid(2) move 'CICS02' to t-cics-uid(2) * move 'WDWS08' to t-wdws-uid(3) move 'CICS03' to t-cics-uid(3) |
Code: |
move t-wdws-tbl to t-cics-tbl |
Code: |
01 T-IDAM-TBL. 05 T-IDAM-RADER OCCURS 10 ASCENDING KEY IS T-WDWS-UID INDEXED BY X-WDWS. 10 T-WDWS-UID PIC X(8). 10 T-CICS-UID PIC X(6). |
Code: |
MOVE 'WDWS10' TO T-WDWS-UID(1) MOVE 'CICS02' TO T-CICS-UID(1) MOVE 'WDWS09' TO T-WDWS-UID(2) MOVE 'CICS01' TO T-CICS-UID(2) MOVE 'WDWS08' TO T-WDWS-UID(3) MOVE 'CICS03' TO T-CICS-UID(3) |
Code: |
SORT T-IDAM-RADER ON ASCENDING KEY T-WDWS-UID DISPLAY T-IDAM-TBL MOVE 'WDWS09' TO W-SEARCH-KEY PERFORM 2000-SEARCH-USERID |
Code: |
** WE ARE DONE WITH WINDOWS ID, NOW MOVE TO CICS SEARCH ID PERFORM 1000-SWITCH-USERID SORT T-IDAM-RADER ON ASCENDING KEY T-WDWS-UID DISPLAY T-IDAM-TBL MOVE 'CICS04' TO W-SEARCH-KEY PERFORM 2000-SEARCH-USERID . 1000-SWITCH-USERID. PERFORM VARYING X-WDWS FROM 1 BY 1 UNTIL X-WDWS > 10 MOVE SPACES TO T-WDWS-UID(X-WDWS) MOVE T-CICS-UID(X-WDWS) TO T-WDWS-UID(X-WDWS) MOVE SPACES TO T-CICS-UID(X-WDWS) END-PERFORM . 2000-SEARCH-USERID. SEARCH ALL T-IDAM-RADER AT END DISPLAY 'MISSING USERID : ' W-SEARCH-KEY WHEN T-WDWS-UID(X-WDWS) = W-SEARCH-KEY DISPLAY ' USERID FOUND : ' T-WDWS-UID(X-WDWS) END-SEARCH |
Code: |
move t-key-column(x-wdws) to somewhere |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours