SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
yabwon
Onyx | Level 15

Hey SAS-C!

Just FYI.

Bart

 

SAS Packages Framework, version 20230520,

Available at GitHub: https://github.com/yabwon/SAS_PACKAGES

Fixes:

Packages:

  • The BasePlus package, version 1.24.1 was regenerated with latest version of the framework.
  • The %RainCloudPlot() macro from the BasePlus packages was updated with new parameters (see the documentation).

 

Base Plus [1.24.1]: https://github.com/SASPAC/baseplus

  • The %RainCloudPlot() macro from the BasePlus packages was updated with new parameters:
    • sganno - Optional, default value is empty.
      keeps name of a data set for the sganno= option
      of the SGPLOT procedure.

    • sgPlotOptions - Optional, default value is noautolegend noborder.
      List of additional options values for SGPLOT procedure.

    • odsGraphicsOptions - Optional, default value is empty.
      List of additional options values for ODS Graphics statement.
      By default only the: width=, height=, and antialiasmax=
      are modified.

Example: Rain Cloud plot with formatted groups and annotations.

  data annotation; 
    function="text";
    label="This graph is full(*ESC*){sup '2'} of annotations!";
    drawspace="graphpercent";
    rotate=30;
    anchor="center";
    textsize=32;
    x1=50;
    y1=50;
    textcolor="red"; 
    justify="center";
    textweight="bold";
    width=100;
    widthunit="percent";
  run; 

  proc format;
    value system
    1="Windows"
    2="MacOS"
    3="Linux"
    ;
  run;

  data test;
    do system = 1 to 3;
      do i = 1 to 30;
        x = rannor(123)/system;
        output;
      end;
    end;
    format system system.;
  run;


  %RainCloudPlot(test, system, x
  , formated=1
  , sganno=annotation
  , sgPlotOptions=noborder
  , WidthPX=2000
  , HeightPX=420
  )
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



2 REPLIES 2
yabwon
Onyx | Level 15

The BasePlus package [ver. 1.24.2]

Current release is natural continuation of 1.24.1

Updates:

  • The %RainCloudPlot() has 2 new parameters: catLabelAttrs and xLabelAttrs:

    • catLabelAttrs - Optional, default value is empty.
      List of attributes for group axix labels (vertical).

    • xLabelAttrs - Optional, default value is empty.
      List of attributes for data variable axix labels (horizontal).

    The catLabelAttrs and xLabelAttrs should be space separated lists of key=value pairs,
    e.g. xLabelAttrs=size=12 color=Pink weight=bold, see Example below.

  • Documentation was updated (new examples with plots), and some spellings were fixed.

The SHA256 hash digest for package BasePlus:
F*2A4F3953EC56DB914024457F74286D565C23DCF220FF151040BDB704FD8DDB06


Example: Rain Cloud plot for sashelp.cars dataset with groups by Origin or Type for Invoice variables:

  %RainCloudPlot(
    sashelp.cars(where=(Type ne "Hybrid"))
  , Origin Type
  , Invoice 
  , HeightPX=300 
  , y2axisLevels=3
  , catLabels=("Continent of Origin", "Car Type")
  , xLabels="Invoice, [$]"
  , xLabelAttrs=size=12 color=Pink weight=bold
  )
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



yabwon
Onyx | Level 15

The BasePlus package [ver. 1.26.0]

Located at: https://github.com/SASPAC/baseplus


Updates:

Two new macros were introduces in the release:

  • %findDSwithVarVal() macro searches for all datasets (available for a given session) containing a variable of a given value.
  • %getTitle() macro extract text of titles or footnotes into a delimited list.

Documentation updated.

 

Note:

With this release the BasePlus gained its first official co-author: Quentin McMullen ( @Quentin  ) who provided the %getTitle() macro.


Examples:

EXAMPLE 1. Search numeric variable AGE containing value 14:

  %findDSwithVarVal(age, 14, type=num)

EXAMPLE 2. Search library WORK for variable NAME starting with value Jo ignoring cases and trimming blanks from value:

  data A;
    name="Joanna";
  data B;
    name="john";
  data C;
    name="  Joseph";
  data D;
    name="  joe";
  run;

  %findDSwithVarVal(name, Jo, ic=1, tb=1, cts=1, lib=WORK)

EXAMPLE 3. Get titles in different forms:

  title1 j=c "Hi Roger" ;
  title2 j=l "Good Morning" ;
  title3 "How are you?" ;
  title4 ;
  title5 "Bye bye!" ;

  %put %GetTitle() ;

  %put %GetTitle(1 3,dlm=c, qt=[]) ;

  %put %GetTitle(2:4,dlm=s, qt='') ;
 
 
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1088 views
  • 2 likes
  • 1 in conversation