CopyBooks,.cpy files,WTX Design Studio

809 Views Asked by At

I am working on WTX design Studio with copybooks,i have a copybook but i dont have any corresponding sample input regarding that .cpy file .

Are there any means to generate a sample text file from copy book rather than writing the text document manually?

1

There are 1 best solutions below

0
On

As bill said there are lots of ways depending on the tools available:

  1. Ask for sample file
  2. There are packages that can generate data. As I do not work at your site I do not know if any have been installed. They tend to be expensive though
  3. Write a Cobol program (I presume the source is a mainframe) so it would have to be done on the mainframe.
  4. I presume the source is a Mainframe, get on the Mainframe and use FileAid (or FileMaster or whatever they have) to setup the file. FileAid and its ilk let you edit files with a Cobol copybook.
  5. Use the RecordEditor to create the file. You can import Cobol Copybooks into the RecordEditor and then use them to edit Cobol-Data files.
  6. Use a RecordEditor macro to generate a file;
  7. Write a Java / jython / JRuby program with Cobol interface package (have a look on sourceforge)
  8. There are a lot of other possibilities, as I do not know what software or skills you have I can not really advise.

RecordEditor Macro to generate some numeric data:

  /******************************************************************
   * Purpose: RecordEditor Example Macroto generate numeric data for a file
   * 
   *  It is best to run this script from a Single Record Screen rather than 
   * a Table screen
   *
   *******************************************************************/     
 var rec = layout.getRecord(0)

 var lines = RecordEditorData.view.createLines(20)
 for (lineNo = 0; lineNo < 20; lineNo++) {
    print(lineNo);
    for (i=0; i < rec.getFieldCount(); i++) {
        try {
            lines[lineNo].getFieldValue(0, i).set(lineNo * 100 + i) 
        } catch(err) {
            lines[lineNo].getFieldValue(0, i).set(i % 10)   
        }
    }
 }

 RecordEditorData.view.addLines(-1,1, lines)

Output from the Macro:

enter image description here