Desktop productivity for business analysts and programmers

Numeric Character

Reply
Contributor
Posts: 25

Numeric Character

Hello

 

My data or variables is giving me this error, from the data. I do not have these variables stated anywhere in my code, but I think maybe its a formatting solution to this error?

 

 

        
52         %macro step0 ;
53         data sasdata.dialerfiles;
54         set /*dialer.mcp_manual_20170124*/
55         dialer2.qual_not_on_dialer_20170101
56         dialer2.march_dialer ;
57         run;
58         %mend step0;
59         %step0;
ERROR: Variable PHONE1 has been defined as both character and numeric.
ERROR: Variable REF7 has been defined as both character and numeric.
ERROR: Variable REF16 has been defined as both character and numeric.
ERROR: Variable PHONE2 has been defined as both character and numeric.
ERROR: Variable Mbr_ID_Indv has been defined as both character and numeric.
ERROR: Variable MBR_PGM_TYPE_ID has been defined as both character and numeric.

Super User
Posts: 7,436

Re: Numeric Character

The variables are defined differently in both datasets. Either convert them, or make sure you get them correctly typed from the source.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 4,817

Re: Numeric Character

You are concatenating two datasets, but the named variables (PHONE1, etc.) have different types in datasets dialer2.qual_not_on_dialer_20170101 and dialer2.march_dialer. Those variables will need to be converted in one of the datasets prior to concatenation.

PG
Super User
Posts: 11,134

Re: Numeric Character

Note that this is a common occurence when relying on Proc Import to bring data into SAS. Import is a guessing procedure and if your data field contents are inconsistent then supposely identical layout files are read with different rules creating numeric variables from one and character from another file.

Ask a Question
Discussion stats
  • 3 replies
  • 146 views
  • 0 likes
  • 4 in conversation