SAS Macro Library

SAS Macro 索引目录

  • 宏数量:6
宏名称功能简介参数列表使用场景
%AUC
standard_sas_macro/AUC.sas

Calculate AUC and Gini statistics from Wilcoxon scores for a binary target and score variable.

基于二分类目标变量和评分变量的 Wilcoxon 统计量计算 AUC 与 Gini 指标。

参数列表 (3)
  • dsninput scored dataset
  • Targetbinary target/class variable
  • scorescore or predicted probability variable
模型评估:评估二分类评分模型的区分度,输出 AUC 和 Gini 指标。
%fleishman
standard_sas_macro/Fleishman.sas

Calculate Fleishman polynomial coefficients for a requested skewness and kurtosis.

根据给定偏度和峰度迭代计算 Fleishman 多项式系数。

参数列表 (3)
  • skewtarget skewness
  • kurttarget kurtosis
  • maxitermaximum number of iterations; default 50
模拟数据生成:为指定偏度和峰度计算 Fleishman 多项式系数。
%cal_the_stats
standard_sas_macro/cal_the_stats.sas

Compute descriptive statistics for one continuous variable from any input dataset, by a split/group variable. Output 4 formatted rows (n, Mean (SD), Median, Min/Max) in wide layout (col1-colN, controlled by byvarn) with table ordering fields for TFL output workflows.

按分组变量对连续型变量计算描述性统计,并输出 n、Mean (SD)、Median、Min/Max 四行宽表结果,用于 TFL 表格数据集组装。

参数列表 (9)
  • dsininput dataset
  • whereWHERE clause (without WHERE keyword); blank = no filter
  • byvargroup/split variable for column layout (col1, col2, ...); must be numeric with consecutive integer values starting from 1
  • byvarnmax number of groups/columns (default 5; array size col1-col&byvarn)
  • ordprimary sort key for downstream table assembly
  • ord1secondary sort key
  • ord2tertiary sort key
  • valnumeric variable name to summarize
  • dsoutoutput dataset name
TFL 表格生产:按治疗组或分析分组生成连续变量描述性统计行。
%drop_zero_rename
standard_sas_macro/drop_zero_rename.sas

Clean wide datasets with dynamic columns: drop character variables that are all '0' (excluding fixed columns), then rename remaining dynamic columns to a sequential prefix (e.g. col1, col2, ...). Used for TFL Outpus workflows.

清理包含动态列的宽表数据集,删除全为 '0' 的字符型动态列,并把保留下来的动态列按指定前缀重新编号。

参数列表 (4)
  • dsininput dataset
  • dsoutoutput dataset
  • fixed_varsspace-delimited vars to keep as-is (never dropped or renamed)
  • prefixrename prefix for remaining dynamic cols (default: col)
TFL 宽表清理:删除全 0 动态列并重编号展示列。
%logparse
standard_sas_macro/logparse.sas

Extract performance and resource usage statistics from a SAS log file.

解析 SAS 日志文件,抽取运行时间、CPU、I/O、内存和观测数等性能统计信息。

参数列表 (5)
  • saslogSAS log file name or log member name
  • outdsoutput dataset for parsed log statistics
  • systemsource operating system identifier; defaults to &sysscp when blank
  • pdslocPDS location used for MVS/OS log members
  • appendappend parsed output to outds, YES or NO; default NO
运行监控:解析 SAS 日志,汇总运行时间、CPU、I/O、内存和观测数。
%sendmail
standard_sas_macro/sendmail.sas

Send an email using macro parameters and/or a metadata dataset containing message text and email options.

根据宏参数或邮件元数据集发送邮件,支持收件人、抄送、主题、附件和正文内容。

参数列表 (10)
  • METADATAmetadata dataset containing email text and optional parameters; default mail
  • TOTo addressee list
  • CCCc addressee list
  • BCCBcc addressee list
  • FROMFrom addressee
  • REPLYTOReply-to addressee
  • SUBJECTemail subject
  • ATTACHattachment list
  • CONTENT_TYPEemail content type
  • ENCODINGemail encoding
自动通知:通过 SAS 邮件引擎发送任务结果、附件或运行状态提醒。

About The Author

Allen Sun

作者:Allen Sun

微信公众号:药企SP程序员Allen

关注公众号,获取 SAS、临床数据编程、TFL 自动化与药企 SP 工作流相关内容。

药企SP程序员Allen 微信公众号二维码
扫码关注公众号

RAG 问答会优先检索这些生成后的 HTML 文档内容。