BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Geoghegan
Obsidian | Level 7

Hello,

I have a dataset with a variable I made called CVD which has 0 or 1 as options only in SAS9.4. This is technically my outcome of my analysis but as a way to display the data I would like to make two boxplots of the exposure values (il6) by CVD value. So I would like one boxplot to be the il6 values for CVD=0 and one for CVD=1. I thought to do this I would just create a copy of my dataset, sort it by CVD, and then use the boxplot function, below: 

 

data stats.adjusted4;
set stats.adjusted3;
run;
proc sort stats.adjusted4;
by descending CVD;
run;
proc boxplot data=stats.adjusted4;
plot log_il6*CVD/ cboxes=black;
run;

 

However, when I ran the proc sort it gave me this error message and I can't figure out what it wants me to do:

291  proc sort stats.adjusted4;
               ---------------
               22
               201
ERROR 22-322: Syntax error, expecting one of the following: ;, ASCII, BUFFNO, DANISH, DATA,
              DATECOPY, DETAILS, DIAG, DUPOUT, EBCDIC, EQUALS, FINNISH, FORCE, IN, ISA, L,
              LEAVE, LIST, MESSAGE, MSG, NATIONAL, NODUP, NODUPKEY, NODUPKEYS, NODUPLICATE,
              NODUPLICATES, NODUPREC, NODUPRECS, NODUPS, NOEQUALS, NORWEGIAN, NOTHREADS,
              NOUNIKEY, NOUNIKEYS, NOUNIQUEKEY, NOUNIQUEKEYS, NOUNIQUEREC, NOUNIQUERECS,
              NOUNIREC, NOUNIRECS, OSA, OUT, OVERWRITE, PAGESIZE, PRESORTED, PSIZE, REVERSE,
              SIZE, SORTSEQ, SORTSIZE, SORTWKNO, SWEDISH, T, TAGSORT, TECH, TECHNIQUE, TESTHSI,
              THREADS, UNIOUT, UNIQUEOUT, WKNO, WORKNO.
ERROR 201-322: The option is not recognized and will be ignored.
292  by descending CVD;
293  run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
 
I've used proc sort before for things like sex and assumed I could with this too. If anyone could help I would greatly appreciate it!
1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

please update the code to below, to use 'data='

 

proc sort data=stats.adjusted4;
by descending CVD;
run;
Thanks,
Jag

View solution in original post

1 REPLY 1
Jagadishkatam
Amethyst | Level 16

please update the code to below, to use 'data='

 

proc sort data=stats.adjusted4;
by descending CVD;
run;
Thanks,
Jag

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2059 views
  • 0 likes
  • 2 in conversation