Posts

NOTUPPER AND NOTLOWER

  Function:   NOTLOWER Purpose:   To  determine the position of the first character in a string that is not a lowercase letter. If none is found, the function returns a 0.  With the use of an optional parameter, this function can begin searching at any position in the string and can also search from right to left, if desired.                                    Syntax : NOTLOWER(character-value <,start>)      character-value   Is any SAS character value. Start is an optional parameter that specifies the position in  the string to begin search. If it is omitted,the search starts at the beginning of the string. If it is non-zero, the search begins at the position in the string of the absolute value of the number (starting from the left position in the string). If the start value is positive, the search goes from left to right; if the string ...

COMPRESS

Function:   COMPRESS

COMPBL(Compress blanks)

Image
  !) Function:   COMPBL Purpose:   To replace all occurrences of two or more blanks with a single blank character.  This is particularly useful for standardizing  addresses and names where  multiple blanks may have been entered. Syntax : COMPBL(character-value)                                 character-value is any SAS character value.             If a length has not been previously assigned, the length of the resulting             variable will be the length of the argument Example: Using the Combl function to convert multiple blanks to single blank. ***Primary function: COMPBL; data squeeze; input # 1 @ 1 Name $20. # 2 @ 1 Address $30. # 3 @ 1 City $15.    @ 20 State $2.    @ 25 Zip $5. ;   Name = compbl(Name);   Address = compbl(Address);   City...

UPCASE, LOWCASE & PROPCASE

Image
!) Function:   UPCASE Purpose:   To  change all letters to uppercase.                                                  NOTE: The corresponding fuction LOWCASE changes uppercase to lowcase Syntax : UPCASE(character-value)                                 character-value is any SAS character value.             If a length has not been previously assigned, the length of the resulting             variable will be the length of the argument Example: ***Primary function: UPCASE ***Other function: DIM; data mixed;   length a b c d e $ 1 ;   input a b c d e x y;   datalines ;   M f P p D 1 2   m f m F M 3 4 ; run ;   data upper;   set mixed;   arra...

Function :MDY

Image
 For the situations where you  only have month, day , and year values but do not have a SAS Date, the MDY functon can create a SAS date value, given the value for the month, day , and year .Kindly find a detailed example on how this is made possible in SAS Purpose:   To create a SAS Date from the month, day and year. Sytax: MDY(month, day, year)               month is a numeric variable or constant representing the month of the year (a number               from 1 to 12 ).               day   is a numeric variable or constant representing  the day of the month (a number                  from 1 to 31 ).               year  is a numeric variable or constant representing the year. Values of the month, day and time that do not define a valid date result in a missing value and...

Function: CALL SORTC

Image
Function That Sorts Character Values       Purpose : To sort the values of its character arguments in ascending order   Syntax : CALL SORTC(<of> Char-1 <, … Char-n>)                        Char-n is a character variable. If you use a variable list in the form                       Var1–Varn, precede the list with the word "of"'.                      Arguments to the CALL SORTC routine cannot be constants. You may use                      array references as arguments to this routine as well (see the following examples):         Examples   ...

Function: Call Sortn

Image
 Function: Call Sortn Purpose: To sort the values of its numeric argument in ascending order. Syntax :  CALL SORTN(<of> Vaar-1 <,  ... Var-n>)               Var-n  is a numeric variable. If you use a variable list in the form VAR1-Varn,                               precede   the list with  the word "of".               Arguments to the CALL SORTN routine cannot be constants. You may use   array                    references as   arguments to this routine as well (see the following examples)    Examples For these examples, x1=8, x2=2, x3=., x4=1, a=9, b=7, c=8. Also, an array is defined as array nums[4] x1-x4;        Call Routine                  ...