That logic is fine for SWA below the line, but I don't think many shops still run that way, at least not the larger ones.
ISTR there was at one time a published Rexx implementation of the SWA-above logic, but I can't put my finger on it just yet. That logic (if found) should be transferable to Enterprise COBOL. Peter -----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of rpinion865 Sent: Friday, May 5, 2023 2:00 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: COBOL to dynamic DD name I don't know if this program is of any use to the original poster. But, I came across the source this afternoon. It would seem if you can read the JFCB, maybe you could update it? IDENTIFICATION DIVISION. PROGRAM-ID. COBJFCB. INSTALLATION. AUTHOR. KEVIN. DATE-WRITTEN. 11/07/2005. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 TCB-ADDRESS-POINTER. 05 TCB-ADDR-POINTER USAGE IS POINTER. 01 TIOT-SEG-POINT. 05 TIOT-SEG-POINTER USAGE IS POINTER. 05 TIOT-SEG-PNT REDEFINES TIOT-SEG-POINTER PIC S9(9) COMP. 01 JFCB-POINT. 05 JFCB-POINTER USAGE IS POINTER. 05 JFCB-POINT-RED REDEFINES JFCB-POINTER. 10 FILLER PIC X. 10 JFCB-LOW-3 PIC X(3). LINKAGE SECTION. 01 DDNAME-DSN-ARRAY. 05 DDNAME-DSN OCCURS 100 TIMES INDEXED BY NDX1. 10 DDA-DDNAME PIC X(8). 10 DDA-DSN PIC X(44). 01 TCB-POINTER USAGE IS POINTER. 01 TCB. 05 FILLER PIC X(12). 05 TIOT-POINTER USAGE IS POINTER. 01 TIOT-START PIC X(24). 01 TIOT-SEG. 05 TIO-LEN PIC X. 05 FILLER PIC X(3). 05 DD-NAME PIC X(8). 05 JFCB-ADDR PIC X(3). 01 JFCB. 05 FILLER PIC X(16). 05 DS-NAME PIC X(44). PROCEDURE DIVISION USING DDNAME-DSN-ARRAY. MOVE LOW-VALUES TO JFCB-POINT. MOVE X'0000021C' TO TCB-ADDRESS-POINTER. SET ADDRESS OF TCB-POINTER TO TCB-ADDR-POINTER. SET ADDRESS OF TCB TO TCB-POINTER. SET ADDRESS OF TIOT-START TO TIOT-POINTER. SET TIOT-SEG-POINTER TO TIOT-POINTER. ADD 24 TO TIOT-SEG-PNT. SET ADDRESS OF TIOT-SEG TO TIOT-SEG-POINTER. SET NDX1 TO 1. PERFORM UNTIL TIO-LEN = LOW-VALUES OR NDX1 > 100 MOVE DD-NAME TO DDA-DDNAME(NDX1) MOVE JFCB-ADDR TO JFCB-LOW-3 SET ADDRESS OF JFCB TO JFCB-POINTER MOVE DS-NAME TO DDA-DSN(NDX1) DISPLAY DDA-DDNAME(NDX1) DDA-DSN(NDX1) ADD 20 TO TIOT-SEG-PNT SET ADDRESS OF TIOT-SEG TO TIOT-SEG-POINTER SET NDX1 UP BY 1 END-PERFORM. GOBACK. -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN