BookmarkSubscribeRSS Feed
HarfordKaren
Calcite | Level 5

I have a SAS program that creates data for a program review datashell. For most of our divisions there are full and part time faculty except for 1. I need the report to show that there is no full time faculty, but when this division gets to the bottom of the program it bombs due to the fact that only the part time faculty is showing up. How can I check to see if fullpart has a Full and put full in there?

 

Here is my code & below is the file that is created:

 

data fac&i.(keep=term_code crn_key division stvsubj_desc fullpart sfrstca_bill_hr);
set prdata.all_class_&i.;
by term_code crn_key;
if last.crn_key;
run;

 

proc summary data=fac&i.(where=(division="&div."));
class stvsubj_desc fullpart;
var sfrstca_bill_hr;
output out=sfac&i.(where=(_type_ in (0,1,2,3))) sum=cr&i.;
run;

 

stvsubj_desc fullpart _TYPE_ _FREQ_ cr1
    0 42 86
  Part 1 42 86
Accounting 2 1 3
Biology   2 2 4
Business Administration 2 2 6
Computer Aided Design & Draft 2 1 3
Engineering Technology 2 1 3
Human Development 2 31 55
Paralegal   2 2 6
Psychology 2 2 6
Accounting Part 3 1 3
Biology Part 3 2 4
Business Administration Part 3 2 6
Computer Aided Design & Draft Part 3 1 3
Engineering Technology Part 3 1 3
Human Development Part 3 31 55
Paralegal Part 3 2 6
Psychology Part 3 2 6
2 REPLIES 2
ballardw
Super User

Can you provide what this is supposed to look like? It isn't quite clear.

 

Also it may help to  provide some example input data.

 

 

One option may be to add the COMPLETYPES option to the Proc statement, provide a format for the FullPart variable with the desired text and then use the PRELOADFMT option on the class statment and use a Format statement to associate the format with the variable for the run.

 

 

HarfordKaren
Calcite | Level 5
stvsubj_desc

fullpart

_TYPE_

_FREQ_

cr1


0

42

86


Full

1

0

0


Part

1

42

86

Accounting

2

1

3

Biology

2

2

4

Business Administration

2

2

6

Computer Aided Design & Draft

2

1

3

Engineering Technology

2

1

3

Human Development

2

31

55

Paralegal

2

2

6

Psychology

2

2

6

Accounting

Part

3

1

3

Biology

Part

3

2

4

Business Administration

Part

3

2

6

Computer Aided Design & Draft

Part

3

1

3

Engineering Technology

Part

3

1

3

Human Development

Part

3

31

55

Paralegal

Part

3

2

6

Psychology

Part

3

2

6


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 869 views
  • 1 like
  • 2 in conversation