BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
France
Quartz | Level 8

Hello all,

 

Could you please explain the meaning of extra number at the end of the row in the log? For example, the following log records the invalid data in DATA Step, and there are a extra '62' at the end of the first two rows and '35' at the end of third rows. these number are not belong to the original data. could you explain what is the meaning of them please? thanks in advance.

 

 NOTE: Invalid data for appln_id in line 68262946 33-34.
 NOTE: Invalid data for publn_date in line 68262946 36-44.
 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9
 68262946  390735978,HK,1053433,09/465,054,A1,275562685,2010-03-26,  ,0,0 62
 pat_publn_id=390735978 publn_auth=HK publn_nr=1053433 publn_nr_original=09/465 publn_kind=054
 appln_id=. publn_date=. publn_lg=2010-03-26 publn_first_grant=. publn_claims=0 _ERROR_=1
 _N_=68262944
 NOTE: Invalid data for appln_id in line 68280355 33-34.
 NOTE: Invalid data for publn_date in line 68280355 36-44.
 68280355  390753387,HK,1092990,60/523,466,A1,275562719,2010-03-26,  ,0,0 62
 pat_publn_id=390753387 publn_auth=HK publn_nr=1092990 publn_nr_original=60/523 publn_kind=466
 appln_id=. publn_date=. publn_lg=2010-03-26 publn_first_grant=. publn_claims=0 _ERROR_=1
 _N_=68280353
 NOTE: Invalid data for publn_date in line 98594248 33-33.
 98594248  184,,A ,930063756,9999-12-31,  ,0,0 35
 pat_publn_id=184 publn_auth=  publn_nr=A publn_nr_original=930063756 publn_kind=9999-12-31
 appln_id=. publn_date=. publn_lg=0 publn_first_grant=. publn_claims=. _ERROR_=1 _N_=98594246
 NOTE: Invalid data for publn_date in line 98614935 36-36.
 98614935  148740,,A ,930101529,9999-12-31,  ,0,0 38
 pat_publn_id=148740 publn_auth=  publn_nr=A publn_nr_original=930101529 publn_kind=9999-12-31
 appln_id=. publn_date=. publn_lg=0 publn_first_grant=. publn_claims=. _ERROR_=1 _N_=98614933
 NOTE: Invalid data for publn_date in line 98619964 36-36.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Yes the last number is the number of characters on the line of data.

 

You apparently are trying to read a variable appln_id with character values such as A1 into a numeric defined variable.

Your variable publn_date may be attempting to use a date format of some sortOR some of your records have a different layout than you think as the value 275562685 is not a valid date. Neither is 9999-12-31 though I suspect that coding was because another data source uses that for "missing date" so the result in SAS of missing would be appropriated.

 

I suspect that those rows shown do not quite match expectations of layout as they appear to have differing numbers of fields.

 

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

If you remove the clutter of the notes and error messages it is clearer what is going on. 

 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9
 68262946  390735978,HK,1053433,09/465,054,A1,275562685,2010-03-26,  ,0,0 62
 68280355  390753387,HK,1092990,60/523,466,A1,275562719,2010-03-26,  ,0,0 62
 98594248  184,,A ,930063756,9999-12-31,  ,0,0 35
 98614935  148740,,A ,930101529,9999-12-31,  ,0,0 38

Can you see the pattern now?

Try running a data step with the LIST command.

data _null_;
  infile 'myfile' obs=10 ;
  input;
  list;
run;
France
Quartz | Level 8

Hello Tom, thanks for your answer.

Do you meaning that extra number shows how many characters of each row? For example, there are 62 characters (include the commas) in the row of 

390735978,HK,1053433,09/465,054,A1,275562685,2010-03-26,  ,0,0

?

ballardw
Super User

Yes the last number is the number of characters on the line of data.

 

You apparently are trying to read a variable appln_id with character values such as A1 into a numeric defined variable.

Your variable publn_date may be attempting to use a date format of some sortOR some of your records have a different layout than you think as the value 275562685 is not a valid date. Neither is 9999-12-31 though I suspect that coding was because another data source uses that for "missing date" so the result in SAS of missing would be appropriated.

 

I suspect that those rows shown do not quite match expectations of layout as they appear to have differing numbers of fields.

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 841 views
  • 1 like
  • 3 in conversation