Rewrite data step for Windows

Accepted Solution Solved
Reply
Super Contributor
Posts: 418
Accepted Solution

Rewrite data step for Windows

Hello everyone, I was trying to figure out how to create a user prompted script, and I stumbled upon the following data step.

data _null_;
vbscript=catx('\',pathname('WORK'),'example.vbs');
filvar=vbscript;
file vbs filevar=filvar lrecl=2000;
put
"Replace with the example VBScripts below";
filvar = catx('\',pathname('WORK'),'dummyFile.txt');
file vbs filevar=filvar;
runvb = 'cscript //nologo '||quote(vbscript);
infile retval  pipe filevar=runvb lrecl=32000 end=eof;
input;
call symputx("parameter1", scan(_INFILE_,1,"<delimiter>"));
run;


However I am working on a windows machine, and it seems to have a problem with the "INFILE PIPE" section. I get an error in the log saying "option Pipe is not known for infile".

Does anyone know how to re-write this above step to work with windows? admittedly I don't understand it at all so I honestly am not sure how to alter it.

Thanks very much!


Accepted Solutions
Solution
‎07-07-2014 08:00 PM
SAS Super FREQ
Posts: 8,743

Re: Rewrite data step for Windows

HI:

  It might be easier to use a prompt variable inside Enterprise Guide, by putting your user-prompted value inside a macro variable and then defining the macro variable as a prompt in an EG project. Or, perhaps the author of the program could help you figure out how to modify the code.

cynthia

View solution in original post


All Replies
Solution
‎07-07-2014 08:00 PM
SAS Super FREQ
Posts: 8,743

Re: Rewrite data step for Windows

HI:

  It might be easier to use a prompt variable inside Enterprise Guide, by putting your user-prompted value inside a macro variable and then defining the macro variable as a prompt in an EG project. Or, perhaps the author of the program could help you figure out how to modify the code.

cynthia

Super Contributor
Posts: 418

Re: Rewrite data step for Windows

Hiya Cynthia! Thanks for your help.  I actually pulled the code off of a pdf "how to guide", so maybe I can try to email the author and see if he responds, I will look into that!

For the other point, we don't have enterprise guide. We only have base sas (or if we do have enterprise guide I am not aware of it or where I would run it from.... But i've never been trained on it so i'll look into it more!).

Thanks!

Super User
Posts: 10,526

Re: Rewrite data step for Windows

Though it seems to have dropped in use, base SAS has a limited ability to display and ask for limited text input via the WINDOW  or %WINDOW functionallity. If you only have a couple of items to input this may be an option.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 194 views
  • 0 likes
  • 3 in conversation