For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2004 > cobol and binary data written by C









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cobol and binary data written by C
hpy_awad@yahoo.com

2004-05-12, 6:47 pm

can cobol read binary data written by fprintf (C function) ?
Malcolm

2004-05-12, 6:47 pm


"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> wrote
>
> can cobol read binary data written by fprintf (C function) ?
>

You're using fprintf() rather badly if you use it to write out binary data.
It is designed for text.
You'd have to ask in a COBOL group for an authorative answer, but I would be
extremely surprised if the language didn't have support for reading
arbitrary data files.


Joe Wright

2004-05-12, 6:47 pm

hpy_awad@yahoo.com wrote:

> can cobol read binary data written by fprintf (C function) ?

I'm not up on what COBOL can do but, fprintf() writes text data, not
binary data.

--
Joe Wright mailto:joewwright@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Mike

2004-05-12, 6:47 pm

> can cobol read binary data written by fprintf (C function) ?

I don't know about fprintf or C funtions but COBOL can read and
write binary data just fine. Care to explain a little better what
it is you're actually trying to do?


LX-i

2004-05-14, 12:30 pm

Joe Wright wrote:

> hpy_awad@yahoo.com wrote:
>
>
> I'm not up on what COBOL can do but, fprintf() writes text data, not
> binary data.


COBOL can read and write both text and binary data - the key is, you've
got to know the structure of the file. You can have variable-length
records, so you could have one record with 10 characters, and another
with 20K.

I've never had experience interchanging data between the two languages,
so I can't tell you the best way to do that, or any problems that may arise.


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ LXi0007@Netscape.net ~
~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ I do not read e-mail at the above address ~
~ Please see website if you wish to contact me privately ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com