There's another way to get the same effect using the STR() function in Monarch, which allows you to specify the length of a string and the fill character.
will return a nine character string stuffed with as many leading zeroes as necessary.
Also, since Monarch v9 (I think), but certainly since v10, there are helpful user defined functions pre-built into Monarch which allow you to work with many common numeric codes.
There's a function called "Check_SSN" which might be helpful: "Performs very simple US Social Security Number verification on a character string representing the SSN. Returns 1 if the number is valid, otherwise returns 0. NOTE, this should only be used as a mechanism for assisting in trapping simple data entry errors, not as a validation technique to avoid fraud. Official tools for employers are available at www.socialsecurity.gov/employer/ssnv.htm"
To access the UDFs, click on the [I]f(x)[/I][/B] icon on the toolbar, from within the table window, and select "import". The functions are available in a model called UserDefinedFunctions.xmod which should be installed in the default models folder.