Do you mind to tell us why do you need this at first place?
How many such copybooks do you have? If fewer then write a COBOL program and pass the copybook name though JCL parm and create files so in short each para in that program corresponds to unique copybook layout.
Joined: 10 May 2007 Posts: 2235 Location: Hampshire, UK
If this is a one-off task and for very few copybook then it would be quicker to construct the records by hand. Otherwise I think you are going to have to do one program per copybook although a Rexx solution could read the copybook and create data for each field as it is read in - but do not come running here when you have to create packed decimal data as there are routines out there on the web - possibly in the rexx forum of this forum.
If you don't have it, download the Smart DFSORT Tricks pdf file (worth even if you have SYNCSORT).
Use all the information in chapter "Create DFSORT Symbols from COBOL Copybook" to map your copybook.
You may want to make some adaptations (no need for group fields or different output format, for example).
Write a COBOL program. Input will be the "symbols" file instead of the COBOL copybook.
As you will have the offset, the length and the format, it should be quite easy to build a "record" containing valid data.
By valid I mean in the correct format. In the example in the pdf file, you have a date and a time fields.
You'll have to detect this (by checking the field name?) and generate logically valid data.
Same goes for other fields (will you need a sequence number or a random number? How to generate a name and so on).