PRO ChopDate,YYMMDD,YY,MM,DD,Error=error tmp=Round(yymmdd+0.D0) ; convert to numeric type if possible IF tmp LT 710000L THEN BEGIN Message,'Date is too early',/Informational yy=-1 & mm=-1 & dd=-1 & error=1 Return ENDIF IF 991231L LT tmp THEN BEGIN Message,'Date is too late',/Informational yy=-1 & mm=-1 & dd=-1 & error=1 Return ENDIF dd=tmp MOD 100 tmp=tmp/100 mm=tmp MOD 100 yy=(tmp/100)+1900 error=0 Return END