WebJan 10, 2024 · /*create second dataset with name split into three columns*/ data my_data2; set my_data1; name1=scan(name, 1, '_'); name2=scan(name, 2, '_'); name3=scan(name, 3, '_'); run; /*view second dataset*/ proc print data=my_data2; Notice that the string in the name column has been split into three new columns. WebJul 12, 2024 · The first option to list the column names of a SAS data set is with the PROC CONTENTS statement. With the syntax below you store the column names in a new table. If you don’t specify the keep options, then the output table will contain not only the column names but also its format, its length, its type, etc.
Solved: Creating a new column - SAS Support Communities
WebSep 22, 2024 · Creating a new column Options RSS Feed Mark Topic as New Mark Topic as Read Float this Topic for Current User Bookmark Subscribe Mute Printer Friendly Page … WebDec 28, 2024 · Question 1 --In i my data i have the columns - probability and Budget. I want to group the data by probability and get sum of budget = Total budget for each probability level. I also want a variable named foretasted Budget … fox hill senior living bethesda md
How to create columns with values based on occurence of words …
WebSep 23, 2024 · Creating a new column Options RSS Feed Mark Topic as New Mark Topic as Read Float this Topic for Current User Bookmark Subscribe Mute Printer Friendly Page BookmarkSubscribeRSS Feed All forum topics Previous Next ☑ This topic is solved. Need further help from the community? sign in and ask a newquestion. Nini1 Obsidian Level 7 WebOct 10, 2024 · I am a beginner in coding in SAS, so the only way I could do this is by typing out a zillion of IF conditions for all the values for creating each new column. However, I'd like the solution to be automatic so that it doesn't matter how many variables there are, what are their names and how many values each one has. WebApr 20, 2024 · When using an IF/THEN/ELSE statement to create a new column in SAS, it sets the column width by using the length of the first assignment statement. In this example, the first assignment statement sets the value of the Return_fix column to No, so the column length is set to 2. fox hill senior living bethesda