%putdata dataout

30 views
Skip to first unread message

scott.raynaud

unread,
Dec 10, 2014, 7:03:37 AM12/10/14
to ive...@googlegroups.com

Not sure this posted the first time I tried, so here's another attempt.  Peter Solenberger helped me with a dataout issue a couple of months ago, and I wanted to make sure I understood correctly.  I have the following code:

 

 

%impute(name=impute, setup=new);

 

datain have;

 

[other code here]

 

run;

 

 

%putdata(name=impute2, setup=new);

 

imputation impute;

 

mult 2;

 

run;

 

 

This does not create text files.  The suggested corrective code was:

 

 

%impute(name=imput_mult1, dir=.,setup=new);

 

datain have;

 

dataout mult1;

 

[other code here]

 

run;

 

 

%putdata(name=impute_mult1, dir=., mult=2, dataout=mult2);

 

 

So I would just need to add the dataout command to the first block of my code and replace the second block with the %putdata, correct?  It's not clear how

 

 

%putdata(name=impute_mult1, dir=., mult=2, dataout=mult2);

 

 

runs setup in the second case.  And does dir=. write the text file to the default directory with the rest of the output?

 

 

Thanks for the feedback.

scott.raynaud

unread,
Dec 11, 2014, 7:01:20 AM12/11/14
to ive...@googlegroups.com
Here's the file I'm modifying:
 
%impute(name=impute, setup=new);
datain have;
[other code here]

ITERATIONS 20;

MULTIPLES 10;

SEED 2713;

run;

 

%PUTDATA(NAME= impute2, SETUP=new);

IMPUTATION impute;

MULT 2;

RUN;

 

%PUTDATA(NAME= impute3, SETUP=new);

IMPUTATION impute;

MULT 3;

RUN;

 

%PUTDATA(NAME= impute4, SETUP=new);

IMPUTATION impute;

MULT 4;

RUN;

 

%PUTDATA(NAME= impute5, SETUP=new);

IMPUTATION impute;

MULT 5;

RUN;

 

%PUTDATA(NAME= impute6, SETUP=new);

IMPUTATION impute;

MULT 6;

RUN;

 

%PUTDATA(NAME= impute7, SETUP=new);

IMPUTATION impute;

MULT 7;

RUN;

 

%PUTDATA(NAME= impute8, SETUP=new);

IMPUTATION impute;

MULT 8;

RUN;

 

%PUTDATA(NAME= impute9, SETUP=new);

IMPUTATION impute;

MULT 9;

RUN;

 

%PUTDATA(NAME= impute10, SETUP=new);

IMPUTATION impute;

MULT 10;

RUN;

 

Here's what I tried (limiting it to 2 multiples and a single iteration each for testing purposes):
 

%impute(name=impute, dir=., setup=new);

datain have;

dataout impute;
[other code here]
 

ITERATIONS 1;

MULTIPLES 2;

SEED 2001;

run;

 

%putdata(name=impute, dir=., mult=2, dataout=impute2);

 

It appears to run the putdata, but only the first file (impute) is created.  If impute2 is being created, I’m not sure where it’s being written.  Not sure what I’m doing wrong.  Would appreciate help.

Cody Olsen

unread,
Jun 18, 2015, 12:23:34 PM6/18/15
to ive...@googlegroups.com
Sorry I am late to this post. But in case it helps anyone else, I usually put multiples into the DATAOUT dataset by adding the "all" command like so:


%impute(name=impute, dir=., setup=new);

datain have;

dataout impute all;
[other code here]
 

ITERATIONS 1;

MULTIPLES 2;

SEED 2001;

run;


Then, if I want just one multiple, I use a datastep. Maybe not as nifty as the %putdata() macro.

-C
Reply all
Reply to author
Forward
0 new messages