| Date: | Fri, 31 Aug 2001 11:55:38 -0700 |
| Reply-To: | "Valone, Toren W." <TValone@DMV.CA.GOV> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Valone, Toren W." <TValone@DMV.CA.GOV> |
| Subject: | Testing for empty file. |
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
How do I test for an empty file??
Here is my code below, It seems that if the file is empty, then Sas does not
populate the _n_ variable. I have also tried
a put all with no results.
//STEP030 EXEC SAS,OPTIONS='NONEWS'
//SASLOG DD SYSOUT=*
//SASLIST DD SYSOUT=*
//***************************************************************//
//* WRITES OUT ESP SYMBOLICS FOR RECEIVE JOB *//
//***************************************************************//
//ESPIN DD DSN=&&ESP,DISP=(,PASS)
//ESPOUT DD DSN=MV.PDG.EDI.ESP,DISP=OLD
//SYSIN DD *
OPTIONS NOCENTER DQUOTE ;
DATA STEP1;
INFILE ESPIN END = EOF;
INPUT ;
IF _N_ = '' THEN DO;
PUT '_N_ IS BLANK';
END;
IF _N_ = 1 THEN DO;
PUT '_N_ IS =1 ';
END;
|