DATA Step, Macro, Functions and more

the meaning of extra number at the end of the row in the log

Accepted Solution Solved
Reply
Contributor
Posts: 36
Accepted Solution

the meaning of extra number at the end of the row in the log

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.

 


Accepted Solutions
Solution
2 weeks ago
Super User
Posts: 13,008

Re: the meaning of extra number at the end of the row in the log

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


All Replies
Super User
Super User
Posts: 7,845

Re: the meaning of extra number at the end of the row in the log

[ Edited ]

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;
Contributor
Posts: 36

Re: the meaning of extra number at the end of the row in the log

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

?

Solution
2 weeks ago
Super User
Posts: 13,008

Re: the meaning of extra number at the end of the row in the log

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.

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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