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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.