FTP Binary File and Verify

  • Follow


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;

0
Reply bracyr (12) 11/2/2006 1:52:12 PM

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@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;

0
Reply hejacobs (85) 11/2/2006 2:01:41 PM


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.

0
Reply bracyr (12) 11/2/2006 2:25:38 PM

A solution is to compare the original mainframe file by reading it
through the mainframe's FTP server.  Filename A and C are the some
file if filename B equals C then the download was successful.

FILENAME A 'ADRP.REPORT.PDF' DISP=SHR;
FILENAME B FTP '\EMITS\REPORT.PDF'  HOST='XX.X.XXX.223'
           USER='XXXX' PASS='XXXXX' RECFM=S DEBUG;

* SEND BINARY PDF TO THE PC *';
DATA NULL;
INFILE A;
FILE   B;
INPUT;
PUT _INFILE_;
RUN;

FILENAME C FTP "'ADRP.REPORT.PDF'"
           HOST='XXXXXXX.XXXXX.XXX.XXX'
           USER='XXXX' PASS='XXXXXXX'  RECFM=S DEBUG;

*COMPARE THE PC COPY VIA FTP TO THE MAINFRAME COPY VIA FTP*;
DATA NULL;
INFILE B _INFILE_=PC RECFM=S NBYTE=N;
INPUT;
INFILE C _INFILE_=MF RECFM=S NBYTE=N;
INPUT;
IF PC NE MF THEN PUT '!!!!PC PDF DOES NOT MATCH MF PDF!!!!';
RUN;

0
Reply bracyr (12) 11/14/2006 8:24:27 PM

3 Replies
45 Views

(page loaded in 0.391 seconds)

Similiar Articles:













7/25/2012 3:16:37 PM


Reply: