View previous topic :: View next topic
|
Author |
Message |
meetsupriyo
New User
Joined: 19 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
Hi,
I have a requirement like below.
Input : Copybook Layout
Output : File with Sample Data in accordance to the copybook layout
Is it possible through any Utility or REXX program?
Thanks.[/b] |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
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. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 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. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
- 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). Good Luck. |
|
Back to top |
|
|
|