Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Program to Convert copybook to C structure
Is there a program that will convert a copybook record layout to a C
structure?  Thanks

Ron



Report this thread to moderator Post Follow-up to this message
Old Post
Karen Monkres
10-21-05 11:55 PM


Re: Program to Convert copybook to C structure
> Is there a program that will convert a copybook record layout to a C
> structure?  Thanks

I've never seen one.

Then again, you can probably convert a 100-member COBOL record to C format
in about 30 minutes and it's 'by definition' a one-time job, so I'm not
surprised no one has ever tried to create a 'utility' to do it

But if you don't know the COBOL datatypes, it would be pretty hard. So
download this...
http://www.flexus.com/ftp/cobdata.zip
.. for a tutorial on COBOL datatypes. (The included software is VERY old an
d
not much fun to use, but the text is still good)

If you have a COBOL source or copyboook, this might be useful:
http://www.flexus.com/ftp/cobfd.zip
That's some MS-DOS (you heard me, MS-DOS) software which will parse your
file and create a report of offsets and data lengths for every variable in
the copybook.

--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@talsystems.com





Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
10-21-05 11:55 PM


Re: Program to Convert copybook to C structure
Micro Focus used to have a utility that created COPY members out of header f
iles
(if I recall correctly) - but I don't recall anything that did the opposite.
  (I
could be wrong on this and I don't know if it is still available)

--
Bill Klein
wmklein <at> ix.netcom.com
"Michael Mattias" <michael.mattias@gte.net> wrote in message
news:hZd6f.1220$Y61.1182@newssvr33.news.prodigy.com... 
>
> I've never seen one.
>
> Then again, you can probably convert a 100-member COBOL record to C format
> in about 30 minutes and it's 'by definition' a one-time job, so I'm not
> surprised no one has ever tried to create a 'utility' to do it
>
> But if you don't know the COBOL datatypes, it would be pretty hard. So
> download this...
> http://www.flexus.com/ftp/cobdata.zip
> .. for a tutorial on COBOL datatypes. (The included software is VERY old a
nd
> not much fun to use, but the text is still good)
>
> If you have a COBOL source or copyboook, this might be useful:
> http://www.flexus.com/ftp/cobfd.zip
> That's some MS-DOS (you heard me, MS-DOS) software which will parse your
> file and create a report of offsets and data lengths for every variable in
> the copybook.
>
> --
> Michael Mattias
> Tal Systems, Inc.
> Racine WI
> mmattias@talsystems.com
>
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
10-21-05 11:55 PM


Re: Program to Convert copybook to C structure
On Fri, 21 Oct 2005 23:44:18 GMT, "William M. Klein"
<wmklein@nospam.netcom.com> wrote:

>Micro Focus used to have a utility that created COPY members out of header 
files
>(if I recall correctly) - but I don't recall anything that did the opposite
.  (I
>could be wrong on this and I don't know if it is still available)

Some IDDs allow us to have working data structures that are read by
multiple languages.

Of course a procedure division copy member doesn't work this way.

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
10-24-05 11:55 PM


Re: Program to Convert copybook to C structure
> Is there a program that will convert a copybook record
> layout to a C structure?

It is unlikely to be useful to do that.  Cobol has types of data that
aren't implemented in C so you cannot just map a struct over a Cobol
record and then expect to use the data items.

For example a Cobol alphanumeric data item may be PIC X(24) and this is
space filled 24 characters. C would usually require a null terminator
to make this a string and so would need to be char name[25] with null
moved to name[24].

Numeric items may be display format with implied decimal point, or
packed decimal or binary.

The data items will need extracting and converting into a C structure
of your own devicing.


Report this thread to moderator Post Follow-up to this message
Old Post
Richard
10-26-05 02:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:29 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.