Requirement
Read the raw data file dat with list input to create the sas Permanent data set Treatment and create the variables from raw data file in following order.
Patient_Trial_ID(Numeric) >> Treatment (Character) >> Dosing_Instruction (Character)
Now Ensure that your new dataset contains only 3 Variables and 15 Observations.
Raw Data
1 Palcebo "Dosing with 240ml Distilled water"
2 "Active Drug" "Dosing with 240ml Glucose Water"
3 "Active Drug" "Dosing with 240ml Glucose Water"
4 "Palcebo" "Dosing with 240ml distilled water"
5 "Active Drug" "Dosing with 240ml Glucose Water"
6 "Palcebo" "Dosing with 240ml distilled water"
7 "Active Drug" "Dosing with 240ml Glucose Water"
8 "Palcebo" "Dosing with 240ml distilled water"
9 "Palcebo" "Dosing with 240ml distilled water"
10 "Active Drug" "Dosing with 240ml Glucose Water"
11 "Active Drug" "Dosing with 240ml Glucose Water"
12 "Palcebo" "Dosing with 240ml distilled water"
13 "Active Drug" "Dosing with 240ml Glucose Water"
14 "Palcebo" "Dosing with 240ml distilled water"
15 "Active Drug" "Dosing with 240ml Glucose Water"
Can any one sugess me with best answer
What do you have so far? This really looks like homework as well, so you should give it a try.
@270992 wrote:
Requirement
Read the raw data file dat with list input to create the sas Permanent data set Treatment and create the variables from raw data file in following order.
Patient_Trial_ID(Numeric) >> Treatment (Character) >> Dosing_Instruction (Character)
Now Ensure that your new dataset contains only 3 Variables and 15 Observations.
Raw Data
1 Palcebo "Dosing with 240ml Distilled water"
2 "Active Drug" "Dosing with 240ml Glucose Water"
3 "Active Drug" "Dosing with 240ml Glucose Water"
4 "Palcebo" "Dosing with 240ml distilled water"
5 "Active Drug" "Dosing with 240ml Glucose Water"
6 "Palcebo" "Dosing with 240ml distilled water"
7 "Active Drug" "Dosing with 240ml Glucose Water"
8 "Palcebo" "Dosing with 240ml distilled water"
9 "Palcebo" "Dosing with 240ml distilled water"
10 "Active Drug" "Dosing with 240ml Glucose Water"
11 "Active Drug" "Dosing with 240ml Glucose Water"
12 "Palcebo" "Dosing with 240ml distilled water"
13 "Active Drug" "Dosing with 240ml Glucose Water"
14 "Palcebo" "Dosing with 240ml distilled water"
15 "Active Drug" "Dosing with 240ml Glucose Water"
Can any one sugess me with best answer
Please show the code you used. I suspect that you only need to add a DSD option to an infile statement;
data have; infile datalines dlm=' ' dsd missover; informat row best. cat $20. dose $50.; input row cat dose; datalines; 1 Palcebo "Dosing with 240ml Distilled water" 2 "Active Drug" "Dosing with 240ml Glucose Water" 3 "Active Drug" "Dosing with 240ml Glucose Water" 4 "Palcebo" "Dosing with 240ml distilled water" 5 "Active Drug" "Dosing with 240ml Glucose Water" 6 "Palcebo" "Dosing with 240ml distilled water" 7 "Active Drug" "Dosing with 240ml Glucose Water" 8 "Palcebo" "Dosing with 240ml distilled water" 9 "Palcebo" "Dosing with 240ml distilled water" 10 "Active Drug" "Dosing with 240ml Glucose Water" 11 "Active Drug" "Dosing with 240ml Glucose Water" 12 "Palcebo" "Dosing with 240ml distilled water" 13 "Active Drug" "Dosing with 240ml Glucose Water" 14 "Palcebo" "Dosing with 240ml distilled water" 15 "Active Drug" "Dosing with 240ml Glucose Water" ; run;
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!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.