I have the following type of code in sql:
TRANSFORM Max(ConfigValue)
SELECT Config_ID
FROM TABLE_01
GROUP BY Config_ID
PIVOT ConfigField
how do i convert it in sas to get the same result ?
if it is the same case as from this stackoverflow thread:
https://stackoverflow.com/questions/16691853/transform-and-pivot-in-access-2013-sql
then use proc Transpose (https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1xno5xgs39b70n0zydov0owajj8.htm):
data TABLE_01;
infile cards dlm="|";
input Config_ID (ConfigField ConfigValue) (:$20.) ;
cards;
11| Name | Basic
11| Version | 1.01
11| Owner | Jack
12| Name | Advanced
12| Version | 1.03
12| Owner | Andy
;
run;
proc print;
run;
proc transpose data=TABLE_01 out=TABLE_02(drop=_NAME_);
by Config_ID;
id ConfigField;
var ConfigValue;
run;
proc print;
run;
Bart
@TB10 wrote:
I have the following type of code in sql:
TRANSFORM Max(ConfigValue) SELECT Config_ID FROM TABLE_01 GROUP BY Config_ID PIVOT ConfigField
how do i convert it in sas to get the same result ?
What does that gibberish code do? Show an example input. Describe the change you want to make. Show the resulting output for that input.
If you want to calculate some type of maximum value then I you might want to start with PROC SUMMARY.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.
Ready to level-up your skills? Choose your own adventure.