program define ljs
*! 1.1.0 NJC 2 December 1997
* generalisation to several vars
* 1.0.0 NJC 19 September 1997
* left-justify string variables by padding with blanks on right
version 4.0
local varlist "req ex"
parse "`*'"
parse "`varlist'", parse(" ")

while "`1'" != "" {
    local type : type `1'

    if substr("`type'",1,3) == "str" {
        qui replace `1' = trim(`1')
        qui compress `1'
        local type : type `1'
        local spaces : display _dup(80) " "
        local length = substr("`type'",4,.)
        qui replace `1' = /*
         */ `1' + substr("`spaces'",1,`length' - length(`1'))
    }
    else di in bl "`1' is not a string variable"

    mac shift
}

end