Skip to content

Instantly share code, notes, and snippets.

@Cesar-Urteaga
Cesar-Urteaga / lldb_cheat_sheet.md
Created October 24, 2023 17:53 — forked from ryanchang/lldb_cheat_sheet.md
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@Cesar-Urteaga
Cesar-Urteaga / 170724_MSendEmail.sas
Last active March 16, 2023 15:51
Sends an email from SAS with the possibility of attach files.
/*
In order to send an e-mail, you must have access to an SMTP server. If this
has not happened yet, you can enable the SMTP e-mail interface with the
following statement:
OPTIONS EMAILSYS = SMTP;
On the other hand, so as to specify a single SMPT server:
OPTIONS EMAILHOST = <Here goes the email host>;
You can get the above information along with the email port with the following
statement:
%PUT %SYSFUNC(GETOPTION(EMAILSYS))
@Cesar-Urteaga
Cesar-Urteaga / 160225_MCreateStringRange.sas
Last active January 8, 2018 00:03
Macro function that creates a vector, in fact a string, of variable names concatenated with a suffix.
/*-----------------------------------------------------------------------------|
| Description : Macro function that creates a vector, in fact a string, of |
| variable names concatenated with a suffix (a date or a number, |
| depending on the parameters given). |
| Assumptions : The last character of the "Collapse" parameter is useless in |
| the output string for the last created variable name. |
| Parameters : VariablePrefix - Prefix of the variable of interest. |
| InitialSuffix - Initial date of the period in format YYMM. |
| If you give a numeric character with less |
| than 4 digits, it will create a sequence of |
@Cesar-Urteaga
Cesar-Urteaga / 160622_MCompareDataSets.sas
Created June 22, 2017 23:45
Compares two tables, record by record, based on a list of ID variables.
/*-----------------------------------------------------------------------------|
| Description : Macro that compares two tables, record by record, based on a |
| list of ID variables. |
| Assumptions : Each table has at least one ID variable, and ID variables must |
| have the same name between tables. |
| N.B.: This macro is based on the suggestion made in the |
| excellent book "Carpenter's Guide to Innovative SAS |
| Techniques" by Art Carpenter, pages 198 through 200. |
| Parameters : BaseTable - Is the reference table. |
| ReferenceTable - Corresponds to the table that is expected |
@Cesar-Urteaga
Cesar-Urteaga / 160306_MSplitDataset.sas
Created March 7, 2017 03:57
Split a dataset into smaller tables.
/*-----------------------------------------------------------------------------|
| Description : Macro that split a dataset into smaller datasets. |
| Assumptions : This macro is based on the paper "Splitting a Large SAS Data |
| Set" by John R. Gerlach and Simant Misra. |
| Parameters : InputDataset - Table to be split. It can include the |
| library. |
| NumberOfDatasets - Corresponds to the number of split tables. |
| OutputDatasets - Prefix of the split tables. It can include |
| the library. |
| Output : A set of split tables created from the input table. |
@Cesar-Urteaga
Cesar-Urteaga / 161209_MGetTableAttributes.sas
Last active November 3, 2017 17:18
From a set of tables, creates a summary of attributes for each one.
/*-----------------------------------------------------------------------------|
| Description : From a set of tables, creates a summary of attributes for each |
| one. |
| Assumptions : The file extension must be "sas7bdat", and the table names are |
| stored as they are in the libraries (i.e., paths and file |
| names should be case-sensitive). |
| Parameters : InputTable - Table with the paths and file names. |
| OutputTable - Table with the file attributes |
| (Default: InputTable). |
| PathNameVariables - String with the variable names separated |
@Cesar-Urteaga
Cesar-Urteaga / 161214_MRenameTableFields.sas
Created March 4, 2017 23:04
Renames the fields of a table based on a string with field names.
/*-----------------------------------------------------------------------------|
| Description : Renames the fields of a table based on a string with field |
| names. |
| Assumptions : Parameters' table names have the library attached. |
| Parameters : InputTable - Table with the original names. |
| OutputTable - Table with the new names (Default: InputTable). |
| OldNames - String with the old names separated by spaces. |
| NewNames - String with the new names separated by spaces. |
| PrefixCharacter - A prefix to be used to define the new names. |
| Output : A new table (or an overwritten one) with the new names. |
@Cesar-Urteaga
Cesar-Urteaga / 161219_MLoadTables.sas
Last active July 6, 2017 17:47
Creates a group of tables based on the contents of a delimited file.
/*-----------------------------------------------------------------------------|
| Description : Loads a set of libraries and creates a group of tables based |
| on the contents of a delimited file (e.g., a CSV file). |
| Assumptions : The delimited file has the structure used in the examples |
| (please refer to it, see below). |
| Parameters : InputFilePathWithTableNames - Path of the delimited file with |
| the libraries and the tables to |
| be loaded. |
| OutputTable - Table with the contents of the |
| input file (Default: None). |