Skip to content
Prev 106087 / 398506 Next

Problem with sas.get function in Hmisc

_______________________________________________________________________________________


After digging around in the sas.get code, I found a change that seems to
be causing the problem:

old version:

    ...
    status <- sys(paste(sasprog, sasin, "-log", log.file),
        output = FALSE)
    ...

new version:

    ...
    status <- sys(paste(shQuote(sasprog), shQuote(sasin), "-log", 
        shQuote(log.file)), output = FALSE)
    ...


For some reason, sys() bombs when given a command string with quotes in
it. The string works fine when pasted into a command line window, so
maybe it's a problem with the WinXP commmand interpreter? In any case,
changing the sys() call to system() seems to fix the problem.

    ...
    status <- system(paste(shQuote(sasprog), shQuote(sasin), "-log", 
        shQuote(log.file)))
    ...