![]() SAS will automatically keep all variables (including the variable ID). If there is a large number of variables to keep, it is easier to omit the KEEP option. Note: While KEEP can make the data step more efficient when only a small number of variables are needed, KEEP is not a requirement. Set RTRAData.csd2012_disab(keep=DDIS_FL REF_AGE SEX DCLASS DLFS ID) Note that if KEEP is specified, the variable named ID must be included in the list of variables. It is useful when only a small number of variables are needed. SAS will only retrieve the variables listed in the KEEP option. ![]() Applying the KEEP option to the RTRAData data set Applying the KEEP option to the RTRAData data setĪpplying the KEEP option to the RTRAData data set can make the data step more efficient. The new variable SP_WEARN_NUM can then be used as an analysis variable in the RTRA procedures. It is assumed that the values in SP_WEARN include two implicit decimal places. In the data step example below, a new numeric variable SP_WEARN_NUM is created by applying the INPUT function to SP_WEARN. This conversion can be done using the INPUT function. Because of this, SP_WEARN cannot be used as an RTRA statistical analysis variable (in RTRAMean for example). For example, the LFS microdata variable SP_WEARN is a character variable. In some cases, a user may want to convert character microdata values to numeric. For example:ĪgeChar = PUTN(Age, "3.") Converting character values to numeric Converting character values to numeric Note: Unlike the PUT function, for the PUTC and PUTN functions the format to apply (the second argument) must be in quotation marks. PUTN creates a character value by applying a numeric format. ![]() PUTC creates a character value by applying a character format. Since the word PUT is disallowed, users can instead use the PUTC or PUTN functions which are similar to the PUT function. However, users may want to use the PUT function to create character values by applying a format (typically used to convert numeric values to character). The word PUT is not allowed in Real Time Remote Access (RTRA) because the PUT statement allows a user to write values from the microdata to the SAS log. Open all FAQs Close all FAQs Alternative to the disallowed word PUT Alternative to the disallowed word PUT
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |