Sorry to be critical but you really do need to check the return value from malloc() and realloc(). I would also replace the ascending goto with a while loop. Other than that it looks good.

On 16/12/2014 9:13 PM, John McKown wrote:
On Tue, Dec 16, 2014 at 12:46 AM, Paul Gilmartin <
0000000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

On Mon, 15 Dec 2014 22:24:28 -0600, Paul Edwards wrote:

It produces a V-format file that can be
processed by a C program.
As an example, I want to be able to transmit an
SMF file (which I believe contains binary data) to
the PC, and then have a PC program to process
the SMF file. The PC program must handle the
RDW itself, but that's all.

I believe that is even RECFM=VBS.  Does FTP RDW
do something reasonable with the spanning?

​Each segment comes in separately, just as it is on the file. FTP does not
reassemble a spanned record into a single record. So your code must
reassemble the entire record from the segments. I have C code which does
this. If you (or others) would like to look at it, it is available as a
"gist" on GitHub via the URL:
https://gist.github.com/JohnArchieMckown/8ae2fb6f457eaf8d6d7b
​
​Despite its being designed to run under z/OS, it will compile using gcc on
Linux. I don't do Windows programming.​ I don't contend that it is the best
code in the world. But it worked in my minor testing.



IBM's ftp rdw is an excellent file format.

Note that the PC program that handles the SMF
records can also be uploaded to the mainframe
and it continues to work, at least if you are using
PDPCLIB as your C library.

And it handles the spanned records reasonably?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to