BookmarkSubscribeRSS Feed
carles
Fluorite | Level 6

Dear everyone, 

 

Let's assume I have 2 Datasets (Dataset1 and Dataset2), same size, variables, but with some values different.

 

After doing these changes in some values, I have runned some other code that runs on these Datasets, and the result on the both datasets is different. One of the difference i found is that before (using some code) the value .was being transformed to 0, and now this doesnt happen.

For that i have done a proc contents of the table and I have realized the following: 

 

   

carles_0-1593700888700.png

the variables charset and sorted are different among datasets. 

 

(1) Can charset and sorted affect later other code on the data??, 

(2) How can I define this to being equal in dataset1 and dataset2 being equal to the format of dataset2?, can i copy formats generally ??

 

Thank you for you time in advanced,

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Proc contents describes the structure of the data set. Changing any of the value is done by recreating the data set to have a different structure.

If you want to set the SORTED flag, you can for example sort the data with PROC SORT.

If you want to change the encoding, you can for example use the ENCODING= data set option.

 

Note that none of this modifies the data held by the data set. If the . is now a zero, something else (the data, not the data set structure) has changed. Maybe the value was overwritten, or option MISSING was altered.

 

carles
Fluorite | Level 6

How would you define the encoding to appear as blank ??

 

Im not finding it. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 446 views
  • 0 likes
  • 2 in conversation