BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
paulsparrow
Obsidian | Level 7

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"

1 ACCEPTED SOLUTION

Accepted Solutions
FriedEgg
SAS Employee

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

View solution in original post

7 REPLIES 7
art297
Opal | Level 21

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.

paulsparrow
Obsidian | Level 7

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.

art297
Opal | Level 21

I read it wrong.  It is valid in all of those places.  Have you tried simply removing the word 'options'?

paulsparrow
Obsidian | Level 7

Tried that (with and without dash in front of options)  Doesn't work.  See my original post

art297
Opal | Level 21

Have you tried it in the following way?  immediately following sas.exe,

..etc.etc..sas.exe -lrecl 1000

FriedEgg
SAS Employee

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

paulsparrow
Obsidian | Level 7

THANKS!  Worked like a charm.  Sorry just not that good at White Papers.

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2501 views
  • 0 likes
  • 3 in conversation