Passing variable from SAS to Python -


is possible pass macro variable sas python using command line statements passed using 'x' command? far have figured out way of doing involves writing macro variable text file, having python read in.

that method seems possible banana skin in code of having critical step write out text file. i've looked through forum online possible ways of doing not found anything.


the code dynamically generate following string:

%let loader = "%nrstr(finance.yahoo.com/d/... &svar11.+&svar12.+&svar13.+&svar14.+&svar15.+&svar16.+&svar17.+&svar18.+&svar19.‌​+&svar20.+ &svar21.+&svar22.+&svar23.+&svar24.+&svar25.+&svar26.+&svar27.+&svar28.+&svar29.‌​+&svar30.+ &svar31.+&svar32.+&svar33.+&svar34.+&svar35.+&svar36.+&svar37.+&svar38.+&svar39.‌​+&svar40.+ &svar41.+&svar42.+&svar43.+&svar44.+&svar45.+&svar46.+&svar47.+&svar48.+&svar49.‌​%nrstr(&f=)&&fvar&a."; 

here macro variables resolve stock ticker values provided various exchanges earlier in code. original version of code put string in filename url statement, proving slow instead have built in python lot faster still hard coded. yahoo! stream going not support more 200 tickers @ time , tickers being traded updated daily cannot hard code them.

the rough idea pass macro variable &loader command line via x command, have python pick somehow. text file method write out value of resolved string above text file, call python code sas (i'm ok on how that) create variable @ it's end text file. if done passing variable directly sas python via command line lot cleaner think.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -