BookmarkSubscribeRSS Feed
EM1
Calcite | Level 5 EM1
Calcite | Level 5

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?

7 REPLIES 7
Cynthia_sas
SAS Super FREQ

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

EM1
Calcite | Level 5 EM1
Calcite | Level 5

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

Cynthia_sas
SAS Super FREQ


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

Reeza
Super User

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;

Cynthia_sas
SAS Super FREQ

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
EM1
Calcite | Level 5 EM1
Calcite | Level 5

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!

Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2008 views
  • 0 likes
  • 3 in conversation