It's the FORMAT statement in the PROC PRINT step:
You are using the syntax
FORMAT format_name1 label1. format_name2 label2. ...
but the correct syntax (see documentation: FORMAT Statement) is
FORMAT variable_name1 format_name1. variable_name2 format_name2. ...
So, you need to look into dataset cdc.hw7 (or its copy, fda) to find out the names of the four variables to be formatted. You may want to create a list of all variables in the dataset by means of PROC CONTENTS:
proc contents data=fda; run;
Depending on the variable names (which could be, say, sex, occup, jprev and age), your FORMAT statement might look like
format sex Gender. occup Occupation. jprev JudgedPreviously. age Age.;
There is a remote possibility that one or more of the four variables are in fact character variables (see column "Type" in the PROC CONTENTS output). This would cause an error message in the log when you submit the PROC PRINT step, e.g.:
ERROR: You are trying to use the numeric format GENDER with the character variable sex in data set CDC.HW7.
Only in this case you would need to modify the corresponding format definition in the PROC FORMAT step (and rerun that step), e.g.:
VALUE $Gender '1'= 'Female' '2' = 'Male';
and use $Gender. instead of Gender. in the FORMAT statement.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.