DATA Step, Macro, Functions and more

Output problem - Sas University Edition

Reply
New Contributor EM1
New Contributor
Posts: 3

Output problem - Sas University Edition

Hi, i've a problem with sas ue, i can't see the output of macro that i'm using. i'm using this command for import the file:

%macro glimmix_rasch (path='/folders/myfolders', datafile=filename.txt, idlen=2, itmstart=3, nitms=10 );

I've alredy read the different topic on this forum but i can't resolve the problem. Can you help me?

SAS Super FREQ
Posts: 8,864

Re: Output problem - Sas University Edition

Hi:

  This is really a question for Tech Support. Without knowing what your macro program is doing, it is nearly impossible to make any suggestions.

cynthia

New Contributor EM1
New Contributor
Posts: 3

Re: Output problem - Sas University Edition

Posted in reply to Cynthia_sas

Thanks Cynthia, Can you tell me if the command for import the file is correct? I do not know if I set the right path and datafile. Thanks

SAS Super FREQ
Posts: 8,864

Re: Output problem - Sas University Edition


Hi:

  I don't see a "command" to import a file. I see an invocation of a SAS macro program called  %macro glimmix_rasch and without knowing WHAT type of code is being generated by this macro program (as I explained before), it is hard to know whether anything is correct. If, for example, your generated code is supposed to import a DATAFILE, then in your /folders/myfolders location, I would expect to see a file called FILENAME.TXT -- but I can't tell whether FILENAME.TXT is being read from or written to. So I cannot answer your question. That's why I recommended that you work with Tech Support.

  DATAFILE= happens to be an option that you use in PROC IMPORT, so I find it confusing for DATAFILE= to be used as a macro parameter in the macro invocation statement. Based on what you have shown, I would expect someplace in the macro program to see this: &path/&datafile perhaps in an INFILE statement or to see this: datafile="&path/&datafile" in code. But, as I said, that is just speculation and really not useful. Again, I recommend that you work with Tech Support.

cynthia

Super User
Posts: 19,772

Re: Output problem - Sas University Edition

Is this the macro you're referring to:

http://analytics.ncsu.edu/sesug/2013/PO-10.pdf

If so try running each step without the macro and see what happens. You can do that by first creating each macro variable and then running the program step by step rather than by invoking the macro.

i.e. does the following work? Right off the bat, I can see that you have quotations in your path macro variable which would cause it to not work.  They have sample data and output and I would start with that. Pay close attention to how they called the macro, no spaces or quotation marks in the macro variables. Anyways, go through step by step like that and see if you can get it working.

Good Luck!

%let path=/folders/myfolders;

%let datafile=filename.txt;


data one;

infile "&path\&datafile" end = last;

input person $ 1-&idlen @&itmstart (i01 - i&nitms) (1.);

person = RIGHT(person);

if last then call symputx('nperson',_n_);

run;

%put &nperson;

SAS Super FREQ
Posts: 8,864

Re: Output problem - Sas University Edition

Hi,

  Reeza is correct that you will need to be sure that your %LET statements are declared correctly. Also note that the "Windows slash" \ will not work in your path on the University Edition and so, you will need to "flip the slash" to be a "Unix slash" or / in the INFILE statement.

  Also, that means you should NOT pre-quote your path in the macro invocation. You show quotes around the value for PATH= and I believe that putting quotes there will cause you further problems. The quotes belong to the INFILE statement and they are there in the program. The quotes do NOT belong in the invocation where you supply the text string to use for &PATH.

cynthia


macro_code_from_paper.png
New Contributor EM1
New Contributor
Posts: 3

Re: Output problem - Sas University Edition

Posted in reply to Cynthia_sas

Thanks Cynthia!  now the software work , but when i do a simulation with a little number of observations , it work very well, but with the real data ( whit 25509 observations) it doesn't work,  remain "in esecution" for a long time. What is the problem? Thanks for all!

SAS Super FREQ
Posts: 8,864

Re: Output problem - Sas University Edition

Hi: There have been some previous postings about the long "Running" issue that some folks have encountered. I believe there is an update for it.

cynthia

Ask a Question
Discussion stats
  • 7 replies
  • 864 views
  • 0 likes
  • 3 in conversation