PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 17, 2022

[FIXED] how to get rid of warning -- NOTE: Invalid numeric data, secdiags='V146'

 July 17, 2022     sas, warnings     No comments   

Issue

I have written the following code that runs with warnings like

NOTE: Invalid numeric data, secdiags='V4975' , at line 68 column 6.
NOTE: Invalid numeric data, secdiags='V4589' , at line 68 column 6.
NOTE: Invalid numeric data, secdiags='V146' , at line 68 column 6"

Due to these warnings, records with these values are getting dropped off from the final output. What should I do to keep these values in?

Diag1, diag2, diag3...diagN columns are char columns with values like V4965 V4966 V4967 V520 3536 9059 99760 99761 99762

 Data work.temp1 ;
  set work.nocabg;   

 array secdiaggg {*} diag: ; 
 array diag{*} diag:;     


LENGTH j 3.;
j = 1;       
/* put diag1= diag2 = diag3= diag[n]= into 1 code per line.*/
do until ( j > dim(secdiaggg)); 
    secdiags = diag[j];   /* Creates new CHAR column name secdiags */
    j = j + 1;
    IF secdiags NE . THEN OUTPUT;;  /* This put each Diag code on a separate line for the patient. */
end; 

drop j; run;


Solution

I don't know why you have two arrays of the same variables (secdiaggg and diag), but you presumably are running into an issue with this line:

IF secdiags NE . THEN OUTPUT;;

. is numeric missing. secdiags is character. So you want

IF secdiags NE ' ' THEN OUTPUT;

Or, better:

if not missing(secdiags) then output;

as the missing function tests both equally.



Answered By - Joe
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing