I am trying to write a batch file and have my sas session allow for fields of 1000 charactors. Can't seem to get it to work. Any suggestions. (SAS 9.2)
"C:\Program Files\SAS\SASFoundation\9.2\SAS.EXE" options lrecl=3000 -icon -noterminal -nosplash -noxwait -noxsync -CONFIG "C:\Program Files\SAS\SASFoundation\9.2\SASV9.CFG" -SYSIN "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.sas" -LOG "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.log"
Since you appear to try and execute this code as a batch process your should add the -batch system option. All system options should be defined by -[option] <[value]>
C:\Program Files\SAS\SASFoundation\9.2\SAS.EXE" -batch -lrecl 3000 -icon -noterminal -nosplash -noxwait -noxsync -CONFIG "C:\Program Files\SAS\SASFoundation\9.2\SASV9.CFG" -SYSIN "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.sas" -LOG "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.log
Usually I prefer to keep lrecl option parameters inside my programs and use an options statement or on my filename statement or infile statement.
Options Statement syntax:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289431.htm
Filename Statement syntax:
http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#chfnoptfmain.htm
Infile Statement syntax:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm
Take a look at: http://support.sas.com/kb/15/883.html
You have to be runing 9.2 or newer and the options has to be in the configuration file.
From the above mentioned documentation:
Submitting a SAS program via a batch file imposes a maximum
length limit of 256 characters prior to SAS 9.2. For SAS 9.2
and beyond you can use the new SAS system option of LRECL= to
specify a range of 1-32767 to use for reading and writing
external files. The default for the LRECL= system option is
256. This option is valid in the configuration file, at SAS
invocation, the OPTIONS statement, or the SAS Systems Option
window. Under z/OS, the LRECL= system option is recognized only
for reading and writing HFS files.
I have read this but I am unable to decipher. Looking for an example of where I put the options statement (batch file or cfg file) and how do I write it.
I read it wrong. It is valid in all of those places. Have you tried simply removing the word 'options'?
Tried that (with and without dash in front of options) Doesn't work. See my original post
Have you tried it in the following way? immediately following sas.exe,
..etc.etc..sas.exe -lrecl 1000
Since you appear to try and execute this code as a batch process your should add the -batch system option. All system options should be defined by -[option] <[value]>
C:\Program Files\SAS\SASFoundation\9.2\SAS.EXE" -batch -lrecl 3000 -icon -noterminal -nosplash -noxwait -noxsync -CONFIG "C:\Program Files\SAS\SASFoundation\9.2\SASV9.CFG" -SYSIN "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.sas" -LOG "X:\Paul\Programs\Major\Onboarding\Code\onboarding_trial_030_em.log
Usually I prefer to keep lrecl option parameters inside my programs and use an options statement or on my filename statement or infile statement.
Options Statement syntax:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289431.htm
Filename Statement syntax:
http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#chfnoptfmain.htm
Infile Statement syntax:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm
THANKS! Worked like a charm. Sorry just not that good at White Papers.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.