This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------| | |
| 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------| | |
| 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------| | |
| 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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------| | |
| 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. | |