I played with the approach you suggest and abandoned the effort. Too hard, and 
too likely to break.

What I did do that worked was code a number of atomic assembler routines that 
could be passed a DCB that was kept in an area that I malloc or new in C or 
C++. One of those routines was

    int MAKEDCB(void *DCBarea, const int DCBareaLen, const char *DCBtype, const 
char DDname[8]);

It constructs a DCB in the C/C++ allocated area by moving in a model. DCBtype 
is, e.g., "BPAM". Other routines are, e.g., 

    int OPNDCBIN(void *DCBarea);        // OPEN a DCB for input

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Larry Slaten
Sent: Wednesday, July 14, 2021 7:45 AM
To: [email protected]
Subject: Mixing C/C++ with LE-conforming IBM HLASM

I am attempting to use the C/C++ FOPEN function to open a SYSLIB DD 
pointing to a concatenation of executable libraries.  Then extract the 
DCB address so that I can use it to populate the LOAD and BLDL macro.  
This would make it easier to keep the root program RENT.  I realize that 
I can code the DCB in the root assembler program and do what is 
necessary to keep the program RENT.  But, using the C/C++ functions 
would make it simpler.  I have used the FOPEN function to open the data 
set, retrieved the file pointer.  The file pointer points to another 
31-bit address. I have dumped the storage around that 31-bit address, it 
still doesn't look like a DCB.  I  do see "SYSLIB" at +84 bytes, so I 
appear to be close to the answer.  Does anybody know to obtain the DCB 
address using the file pointer returned by FOPEN?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to