Hello, Dave:
If you create the object from the DDS source (e.g. PF, LF or DSPF or 
PRTF etc.), then the IBM COBOL compilers will do this for you 
automatically when you compile your program and reference an "externally 
defined" *FILE.   For example, below, I show a snippet of code from a 
COBOL listing where I have the statement COPY DDS-ALL-FORMATS OF FILEA 
(on line 19) and you can see the lines immediately below that show the 
"generated" code, with "<-ALL-FMTS" markers.
18  001800 FD  
FILEA                                                                     
19  001900     COPY DDS-ALL-FORMATS OF 
FILEA.                                           
20 +000001       05  FILEA-RECORD PIC 
X(50).                                           <-ALL-FMTS
   +000002*    I-O FORMAT:AR         FROM FILE FILEA      OF LIBRARY 
ISS               <-ALL-FMTS
   
+000003*                                                                            
<-ALL-FMTS
21 +000004       05  AR            REDEFINES 
FILEA-RECORD.                             <-ALL-FMTS
22 +000005           06 AKEY                  PIC 
X(10).                               <-ALL-FMTS
23 +000006           06 ADATA                 PIC 
X(40).                               <-ALL-FMTS
So, if you really needed to convert DDS source to COBOL source, perhaps 
you could just "cut-and-paste" from the compiler listing? This would be 
a lot less 'work" than parsing the DDS source. You could even write a 
program (or command) that would:
1. create the *FILE (in QTEMP) from the DDS source
2. ensure QTEMP is at the top of the *LIBL
3. generate and compile COBOL source with an embedded "COPY 
DDS-ALL-FORMATS OF " filename
4. read the listing spool file and copy the relevant lines (marked with 
"<-ALL-FMTS") to a target source member
HTH,
Mark S. Waterbury
> Dave Snyder wrote:
Looking for a way to have a DDS source file definition translated into a
COBOL copybook format. Any ideas?
Dave 
  
As an Amazon Associate we earn from qualifying purchases.