COCRDSLC
Source: cbl/COCRDSLC.cbl
Type: CICS transaction program
Purpose
COCRDSLC is a CICS transaction program (transaction ID CCDL) that lets a user look up and display the details of a single credit card — account ID, card number, embossed name, expiration date, and active status. It supports being entered directly (prompting the user for an account/card number) or being invoked from the Credit Card List screen (COCRDLIC) with search criteria already supplied. It presents its results on the CCRDSLA map (mapset COCRDSL) and hands off to the calling program or main menu (COMEN01C) on exit.
How it works
Processing is driven by 0000-MAIN, which sets up a CICS abend handler (HANDLE ABEND → ABEND-ROUTINE), initializes working storage, and restores the caller's commarea (CARDDEMO-COMMAREA plus a program-specific extension WS-THIS-PROGCOMMAREA) if one was passed in (EIBCALEN not zero).
-
PF-key normalization — YYYY-STORE-PFKEY translates the AID key pressed into a standard value; only Enter and PF3 are considered valid (PFK-VALID/PFK-INVALID), otherwise Enter is assumed.
-
Main dispatch (EVALUATE TRUE in 0000-MAIN):
-
PF3 — builds return-to program/transaction info from CDEMO-FROM-* (falling back to the main menu literals if blank) and does an EXEC CICS XCTL to leave the program.
-
First entry from the Credit Card List program (CDEMO-PGM-ENTER and CDEMO-FROM-PROGRAM = COCRDLIC) — trusts the incoming account/card number as already validated, calls 9000-READ-DATA to fetch the card, then 1000-SEND-MAP to display it, then returns.
-
First entry from any other context (CDEMO-PGM-ENTER) — just sends the empty search screen via 1000-SEND-MAP prompting for input.
-
Re-entry (CDEMO-PGM-REENTER, i.e., user pressed Enter on the screen) — performs 2000-PROCESS-INPUTS to receive and validate the map; if validation fails it re-displays the map with the error; otherwise reads the card data (9000-READ-DATA) and re-displays the map with results.
-
Any other/unexpected combination — treated as a defensive/unreachable branch: sets up abend fields and calls SEND-PLAIN-TEXT (note: this paragraph is invoked but the abend is not actually raised via EXEC CICS ABEND in this branch — it only prepares abend variables and sends a text message).
-
After the EVALUATE, if an input error is still flagged, the map is re-sent with the error message before falling through to COMMON-RETURN.
-
COMMON-RETURN — copies the error message into the map's error field, reassembles the commarea (application commarea + program-specific data), and does EXEC CICS RETURN with TRANSID(CCDL), so the transaction re-enters itself pseudo-conversationally on the next user input.
Screen display is broken into four sub-steps under 1000-SEND-MAP: - 1100-SCREEN-INIT — clears the map, sets titles, transaction/program name, and current date/time. - 1200-SETUP-SCREEN-VARS — populates account ID, card number, embossed name, expiry date, and status fields from working storage; sets the informational prompt message. - 1300-SETUP-SCREEN-ATTRS — sets field protection (editable vs. protected) and cursor position depending on where the request came from and which fields failed validation; sets colors (red for invalid fields) and message coloring. - 1400-SEND-SCREEN — performs the actual EXEC CICS SEND MAP with ERASE/FREEKB, and marks the program state as CDEMO-PGM-REENTER so the next invocation is treated as continuation.
Input processing (2000-PROCESS-INPUTS) is: - 2100-RECEIVE-MAP — EXEC CICS RECEIVE MAP into CCRDSLAI. - 2200-EDIT-MAP-INPUTS — normalizes */spaces into low-values, then calls 2210-EDIT-ACCOUNT and 2220-EDIT-CARD to validate each field individually (must be numeric, non-zero, correct length), and applies a cross-field check: if both account and card filters are blank, sets NO-SEARCH-CRITERIA-RECEIVED.
Data retrieval (9000-READ-DATA → 9100-GETCARD-BYACCTCARD, and an alternate 9150-GETCARD-BYACCT paragraph) reads the card file directly by RIDFLD (record ID built from account/card number in WS-CARD-RID) using EXEC CICS READ FILE(LIT-CARDFILENAME) RIDF(...). The source shown is truncated at the start of this READ, so full response-code handling for 9100-GETCARD-BYACCTCARD (and the logic of 9150-GETCARD-BYACCT, which is never called by any performed paragraph in this excerpt) is not visible.
Inputs & outputs
No SQL tables are used by this program (confirmed — sql_tables is empty); all persistent data access is via CICS file control (EXEC CICS READ).
Things to know
-
Hard-coded literals: transaction ID CCDL, program name COCRDSLC, mapset COCRDSL, map CCRDSLA, file names CARDDAT/CARDAIX, and the related program COCRDLIC/COMEN01C names/tranids are all embedded as WS-LITERALS constants rather than configuration — any rename requires a recompile.
-
Truncated source: the excerpt cuts off mid-statement inside 9100-GETCARD-BYACCTCARD (the EXEC CICS READ ... RIDF clause). Response code handling for this read, the full logic of 9100-GETCARD-BYACCTCARD-EXIT, and the entirety of 9150-GETCARD-BYACCT are not visible in the provided source, so their error paths/behavior cannot be confirmed from what's shown.
-
9150-GETCARD-BYACCT appears unreachable: it is defined but not listed as performed by any other paragraph in the parsed call graph — its purpose (likely an account-only fallback lookup) is unconfirmed and may be dead code, or the call to it exists in the untruncated portion of the source not shown here.
-
Defensive WHEN OTHER branch: in 0000-MAIN's dispatch, an unexpected combination of flags sets up abend-style fields (ABEND-CULPRIT, ABEND-CODE '0001') and message text but only performs SEND-PLAIN-TEXT — it does not appear to actually invoke EXEC CICS ABEND in this branch, so the "abend" is really just a message display, not a hard abend. This is worth confirming against ABEND-ROUTINE.
-
Commarea size assumptions: the program manually slices DFHCOMMAREA/WS-COMMAREA using LENGTH OF CARDDEMO-COMMAREA and appends a fixed-size program extension. If CARDDEMO-COMMAREA layout changes elsewhere, this offset-based copy could silently misalign data.
-
Validation duplicates messages: SEARCHED-ACCT-ZEROES and SEARCHED-ACCT-NOT-NUMERIC are two different 88-level condition names mapped to the same text value — a cosmetic redundancy in the copybook-like message table.
-
Screen re-entry protocol: the program relies on CDEMO-PGM-REENTER/CDEMO-PGM-ENTER flags in the commarea to distinguish first-call vs. postback; the transaction is re-driven via EXEC CICS RETURN TRANSID(...), so it depends on CICS pseudo-conversational restart semantics rather than a single-shot call — care needed if reused outside CICS.
-
Input normalization: users can clear a filter field using * or spaces, which the program converts to LOW-VALUES internally — a UI convention that isn't obvious from the field definitions alone.
CICS commands
HANDLE ABEND, XCTL, RETURN, SEND MAP, RECEIVE MAP, READ, SEND TEXT, SEND, ABEND
Copybooks
COCOM01Y, COCRDSL, COTTL01Y, CSDAT01Y, CSMSG01Y, CSMSG02Y, CSUSR01Y, CVACT02Y, CVCRD01Y, CVCUS01Y, DFHAID, DFHBMSCA
Unresolved conditions
Numeric comparisons with no matching 88-level condition-name anywhere in this program or the copybooks it COPYs — no meaning found in the source export, not guessed.
| Field | Value | Line |
|---|---|---|
EIBCALEN |
0 |
268 |
EIBCALEN |
0 |
459 |
CDEMO-ACCT-ID |
0 |
462 |
CDEMO-CARD-NUM |
0 |
468 |
Paragraph flow
flowchart TD
0000_MAIN["0000-MAIN"]
COMMON_RETURN["COMMON-RETURN"]
0000_MAIN_EXIT["0000-MAIN-EXIT"]
1000_SEND_MAP["1000-SEND-MAP"]
1000_SEND_MAP_EXIT["1000-SEND-MAP-EXIT"]
1100_SCREEN_INIT["1100-SCREEN-INIT"]
1100_SCREEN_INIT_EXIT["1100-SCREEN-INIT-EXIT"]
1200_SETUP_SCREEN_VARS["1200-SETUP-SCREEN-VARS"]
1200_SETUP_SCREEN_VARS_EXIT["1200-SETUP-SCREEN-VARS-EXIT"]
1300_SETUP_SCREEN_ATTRS["1300-SETUP-SCREEN-ATTRS"]
1300_SETUP_SCREEN_ATTRS_EXIT["1300-SETUP-SCREEN-ATTRS-EXIT"]
1400_SEND_SCREEN["1400-SEND-SCREEN"]
1400_SEND_SCREEN_EXIT["1400-SEND-SCREEN-EXIT"]
2000_PROCESS_INPUTS["2000-PROCESS-INPUTS"]
2000_PROCESS_INPUTS_EXIT["2000-PROCESS-INPUTS-EXIT"]
2100_RECEIVE_MAP["2100-RECEIVE-MAP"]
2100_RECEIVE_MAP_EXIT["2100-RECEIVE-MAP-EXIT"]
2200_EDIT_MAP_INPUTS["2200-EDIT-MAP-INPUTS"]
2200_EDIT_MAP_INPUTS_EXIT["2200-EDIT-MAP-INPUTS-EXIT"]
2210_EDIT_ACCOUNT["2210-EDIT-ACCOUNT"]
2210_EDIT_ACCOUNT_EXIT["2210-EDIT-ACCOUNT-EXIT"]
2220_EDIT_CARD["2220-EDIT-CARD"]
2220_EDIT_CARD_EXIT["2220-EDIT-CARD-EXIT"]
9000_READ_DATA["9000-READ-DATA"]
9000_READ_DATA_EXIT["9000-READ-DATA-EXIT"]
9100_GETCARD_BYACCTCARD["9100-GETCARD-BYACCTCARD"]
9100_GETCARD_BYACCTCARD_EXIT["9100-GETCARD-BYACCTCARD-EXIT"]
9150_GETCARD_BYACCT["9150-GETCARD-BYACCT"]
9150_GETCARD_BYACCT_EXIT["9150-GETCARD-BYACCT-EXIT"]
SEND_LONG_TEXT["SEND-LONG-TEXT"]
SEND_LONG_TEXT_EXIT["SEND-LONG-TEXT-EXIT"]
SEND_PLAIN_TEXT["SEND-PLAIN-TEXT"]
SEND_PLAIN_TEXT_EXIT["SEND-PLAIN-TEXT-EXIT"]
ABEND_ROUTINE["ABEND-ROUTINE"]
0000_MAIN --> 1000_SEND_MAP
0000_MAIN --> 2000_PROCESS_INPUTS
0000_MAIN --> 9000_READ_DATA
0000_MAIN -.-> COMMON_RETURN
0000_MAIN --> SEND_PLAIN_TEXT
1000_SEND_MAP --> 1100_SCREEN_INIT
1000_SEND_MAP --> 1200_SETUP_SCREEN_VARS
1000_SEND_MAP --> 1300_SETUP_SCREEN_ATTRS
1000_SEND_MAP --> 1400_SEND_SCREEN
2000_PROCESS_INPUTS --> 2100_RECEIVE_MAP
2000_PROCESS_INPUTS --> 2200_EDIT_MAP_INPUTS
2200_EDIT_MAP_INPUTS --> 2210_EDIT_ACCOUNT
2200_EDIT_MAP_INPUTS --> 2220_EDIT_CARD
2210_EDIT_ACCOUNT -.-> 2210_EDIT_ACCOUNT_EXIT
2220_EDIT_CARD -.-> 2220_EDIT_CARD_EXIT
9000_READ_DATA --> 9100_GETCARD_BYACCTCARD
Paragraphs
| Paragraph | Line | Performs |
|---|---|---|
| 0000-MAIN | 248 | YYYY-STORE-PFKEY, 9000-READ-DATA, 1000-SEND-MAP, 1000-SEND-MAP, 2000-PROCESS-INPUTS, 1000-SEND-MAP |
| COMMON-RETURN | 394 | |
| 0000-MAIN-EXIT | 408 | |
| 1000-SEND-MAP | 412 | 1100-SCREEN-INIT, 1200-SETUP-SCREEN-VARS, 1300-SETUP-SCREEN-ATTRS, 1400-SEND-SCREEN |
| 1000-SEND-MAP-EXIT | 423 | |
| 1100-SCREEN-INIT | 427 | |
| 1100-SCREEN-INIT-EXIT | 453 | |
| 1200-SETUP-SCREEN-VARS | 457 | |
| 1200-SETUP-SCREEN-VARS-EXIT | 499 | |
| 1300-SETUP-SCREEN-ATTRS | 502 | |
| 1300-SETUP-SCREEN-ATTRS-EXIT | 559 | |
| 1400-SEND-SCREEN | 563 | |
| 1400-SEND-SCREEN-EXIT | 578 | |
| 2000-PROCESS-INPUTS | 582 | 2100-RECEIVE-MAP, 2200-EDIT-MAP-INPUTS |
| 2000-PROCESS-INPUTS-EXIT | 593 | |
| 2100-RECEIVE-MAP | 596 | |
| 2100-RECEIVE-MAP-EXIT | 605 | |
| 2200-EDIT-MAP-INPUTS | 608 | 2210-EDIT-ACCOUNT, 2220-EDIT-CARD |
| 2200-EDIT-MAP-INPUTS-EXIT | 643 | |
| 2210-EDIT-ACCOUNT | 647 | |
| 2210-EDIT-ACCOUNT-EXIT | 681 | |
| 2220-EDIT-CARD | 685 | |
| 2220-EDIT-CARD-EXIT | 722 | |
| 9000-READ-DATA | 726 | 9100-GETCARD-BYACCTCARD |
| 9000-READ-DATA-EXIT | 732 | |
| 9100-GETCARD-BYACCTCARD | 736 | |
| 9100-GETCARD-BYACCTCARD-EXIT | 775 | |
| 9150-GETCARD-BYACCT | 779 | |
| 9150-GETCARD-BYACCT-EXIT | 810 | |
| SEND-LONG-TEXT | 820 | |
| SEND-LONG-TEXT-EXIT | 831 | |
| SEND-PLAIN-TEXT | 838 | |
| SEND-PLAIN-TEXT-EXIT | 849 | |
| ABEND-ROUTINE | 857 |