From: bracyr on
I am trying to write a program to download a binary file from the
mainframe to a pc and verify it. The pc file does not match the
original. Any suggestion would be appreciated.

FILENAME A ' main.report.PDF' DISP=SHR;

FILENAME B FTP 'report.PDF' HOST='my.mainframe.com'
USER='xxxxx' PASS='xxxxx' RECFM=S DEBUG;

* down load binary file*

DATA NULL;
INFILE A;
FILE B;
INPUT;
PUT _INFILE_;
RUN;

*compare it the pc copy to the original mainframe file*;

DATA NULL;
INFILE A _INFILE_=MF;
INPUT;
INFILE B _INFILE_=PC NBYTE=N;
INPUT;
PUT MF=;
PUT PC=;
RUN;

From: jaheuk on
Hi,
did you use PROC UPLOAD or PROC DOWNLOAD already ??

example:

RSUBMIT;
FILENAME DATA "MAINFRAME.DSNN.TEST" ;

PROC download
infile = data
outFILE="c:\temp\test.txt"
;
run;

ENDRSUBMIT;


Why compare afterwards ??!!!!???

There is also the BINARY option to preserve the bits and bytes !!

Greetz,
Herman



bracyr(a)gmail.com wrote:
> I am trying to write a program to download a binary file from the
> mainframe to a pc and verify it. The pc file does not match the
> original. Any suggestion would be appreciated.
>
> FILENAME A ' main.report.PDF' DISP=SHR;
>
> FILENAME B FTP 'report.PDF' HOST='my.mainframe.com'
> USER='xxxxx' PASS='xxxxx' RECFM=S DEBUG;
>
> * down load binary file*
>
> DATA NULL;
> INFILE A;
> FILE B;
> INPUT;
> PUT _INFILE_;
> RUN;
>
> *compare it the pc copy to the original mainframe file*;
>
> DATA NULL;
> INFILE A _INFILE_=MF;
> INPUT;
> INFILE B _INFILE_=PC NBYTE=N;
> INPUT;
> PUT MF=;
> PUT PC=;
> RUN;

From: bracyr on
I need to compare in case the FTP fails. I am going to put this in
loop and keep sending the file until it is verified or times out.
Thanks for the tip on proc download and upload.