BookmarkSubscribeRSS Feed
Rsadiq
Calcite | Level 5

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.

3 REPLIES 3
Kurt_Bremser
Super User

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

PGStats
Opal | Level 21

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
ballardw
Super User

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1068 views
  • 0 likes
  • 4 in conversation