Hello,
how can i transpose data if i have transposed data which first few words are the same, and this method take just few words at the start but now thole field, i got error:
ERROR: The ID value "'Dávka pre prípad hospitalizácie'n" occurs twice in the same BY group.
NOTE: The above message was for the following BY group:
K_PART=17 C_PZ=0304626732
But there are not the same words:
There are more words like that, not the same, just the beggining of field is the same, and it just appear to be transposing it be few first letters in the field.
Is there a way how to take whole name and transpose it with whole name in the field (in my case it is field description).
Thank you.
P.
SAS variable names are limited to 32 characters, so your values cause a collision.
What are you trying to achieve? If this is for reporting, PROC REPORT is the right tool.
i have to get all rows in description field to distinct columns... and if it is on the contract so there will be in field 1, so exampe
Contract Mortgage Credit Card
1 1 1
2
3 1
something like that.
never heard of proc report. Can i use the data after in enterprise guide? To work with them after proc report? what is the base syntax pls?
"Working" with such variable names will be a catastrophic pain in the ass, and you should avoid it like hell.
All processing is much better done from a "long" dataset layout. "Wide" is only good for reporting purposes, and needed for a very limited number of tasks (regression analysis among them). For the latter, simpler variable names should be introduced, and your complex strings used as labels.
PROC REPORT will look like this:
proc report data=your_dataset;
column k_part c_pz description,hooo;
define k_part / group;
define c_pz / group;
define description / "" across;
define hooo / "" analysis;
run;
@Pato485 wrote:
i have to get all rows in description field to distinct columns... and if it is on the contract so there will be in field 1, so exampe
Contract Mortgage Credit Card
1 1 1
2
3 1
something like that.
How does this apply to the text fields that you showed originally? Why would you want those text strings as a variable name? Please EXPLAIN further.
SAS works best with long data sets, not wide data sets. Almost all SAS procedures expect long data sets, and wide data sets are much more difficult to work with.
You need to find (or create) another variable that you can use in the ID statement to set the new variable's NAME.
You can use the IDLABEL statement to tell PROC TRANSPOSE to use that DESCRIPTION variable as the new variable's LABEL instead.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.