Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select invalid date

Status
Not open for further replies.

ghazali

IS-IT--Management
Aug 11, 2002
17
0
0
MY
Hi
The data in Mainframe OS390. Which in Binary Format (IB4.)
arrange YYYYMMDD.
Some record have invalid date such as 20001313..

DATA ASNDATA ERRA;
7 INFILE ASNM;
8 INPUT @1 ACNO $9. @10 REGD IB4.;
9 IF INPUT(REGD, YYMMDD8.)= . THEN OUTPUT ERRA;
10 ELSE OUTPUT ASNDATA;

NOTE : Numeric values have been converted to character values at the places given 10:18
Note : Invalid agrument to function INPUT at line 9 column 12.

---------+----------+
1 CHAR 000000013..wE.00000000
ZONE FFFFFFFFF02AC0FFFFFFFF
NUMR 0000000131F65000000000

ACNO=000000013 REGD=19900101

REGD ;; Date Format
 
1. REGD is not a SAS date field nor is a character. It is numerical field.
2. The INPUT function enables you to read the value of source by using a specified informat. The informat determines whether the result is numeric or character. Use INPUT to convert character values to numeric values.

3. Input function requires character field as its source.

4. Your choices are: convert REGD to character field first before apply Input function or use math to check REGD.

 
Please provide me the syntax..
 

data good bad;
input REGD;
if input(put(regd, z8.), ?? yymmdd8.) = . then output bad;
else output good;
datalines;
20021231
20001313
20000132
;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top