0

I have to call a stored procedure that takes a nested cobol datastructure in form of a plain string of 400 bytes length.

I want to avoid to assemble this string manually.

Are there (online) tools that do such a conversion? (i.e. enter structured cobol data and compute the in-memory representation)

If not, what would be the best / easiest way to get the string manually?

Bastl
  • 2,926
  • 5
  • 27
  • 48
  • Tool-recommendation is not on-topic here. Neither is opinion on best/easiest (or other types of request for opinion). If you have the data, it is already in a 400-byte lump. I'm not sure what you mean by a nested COBOL datastructure. If you can tidy some of these things up, it'll help to keep your question from going On Hold. – Bill Woodger May 21 '14 at 16:33
  • As Bill said, It is difficult to understand what you want – Bruce Martin May 21 '14 at 22:37

2 Answers2

0

As Bill said, It is difficult to understand what you want, so can you clarify the question. The

If you do not have the COBOL copybook you need to get it.

But If you want to know the starting position for COBOL fields (in a COBOL Copybook):

  1. Most COBOL compilers will tell you how they will allocate the fields (you may have to specify a compiler option). GNU-Cobol has compatibility modes for several other Compilers (Microfocus, IBM etc) and could be used to get a map for those compilers.
  2. For the mainframe, File-Aid will give you a field map.
  3. For mainframe COBOL, the cb2xml-project will convert a COBOL-Copybook to an Xml file (which lists field starting positions and lengths.
  4. The Record-Editor has a cobol analysis option (Utilities >>> COBOL Copybook Analysis) that will give you a Field map (Mainframe, Gnu-Cobol, Fujitsu-pc) COBOL compilers). The record-editor will also let you enter fields fields and create a file

if you are using Java, LegStar or JRecord could be worth looking at

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
0

this is the tool I was looking for:

http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.j2c.doc/topics/tcreatingdatabinding.html

found via old SO question: Reading cobol datastructures from Java

Community
  • 1
  • 1
Bastl
  • 2,926
  • 5
  • 27
  • 48