Solved

Inputting a macro variable from an external file

Posted on 2013-01-16
6
333 Views
Last Modified: 2013-01-17
I am currently executing a SAS program within an Excel Spreadsheet.  I have a macro variable within the program for member_id.

Is there a way to put the member id numbers in a  cell in Excel and read into the Sas program as a macro variable.
0
Comment
Question by:morinia
  • 3
  • 2
6 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 38783399
Sorry but do not understand your request
gowflow
0
 

Author Comment

by:morinia
ID: 38783515
I am sorry, I tried editting the question and for some reason was knocked out.  I would like to know how to use  a Macro Window to  allow a member_id number to be entered in for use in a SAS program.

I tried using the statements below, but it is not a clean entry.  I would like the cursor to be positioned exactly where the member_id needs to be entered.  Now I have to backspace and delete the all the '9's and enter the ID

%Window SELECT #3@5'Enter the member id numbers:' +1 ck_member 12;
%Let ck_member='999999999';
%Display SELECT;
0
 
LVL 29

Expert Comment

by:gowflow
ID: 38783662
you mean an inputbox statement ???

dim idnumbers as string
idnumbers = inputbox("Please Input ID number","ID number Input","")

is this what you want ?
gowflow
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Expert Comment

by:theartfuldazzler
ID: 38785830
Hi

If the Excel sheet is currently open, you can use DDE Triplets.  This code reads in "Name" from Row1 Column1 in Book1 / Sheet1

filename ex dde 'Excel|[Book1]Sheet1!R1C1';

DATA _NULL_;
infile ex truncover;
input Name $256.;

CALL SYMPUT('Test',Name);
RUN;

%put &test;

Open in new window

0
 
LVL 11

Expert Comment

by:theartfuldazzler
ID: 38785832
PS: The easiest way to figure out the DDE triplet you want is:

1.  In Excel, Copy the cell you want to the clipboard (ie - Select the cell and press Ctrl-C)
2.  In Base SAS (not Guide unfortunately), select Solutions > Accessories > DDE Triplet

A box will open up with the DDE Triplet you need, and you can copy and paste into your program
0
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 total points
ID: 38785886
PPS; And then reading your other comment #38783515

Try this:

%Window SELECT #3@5'Enter the member id numbers:' +1 ck_member 12;
%Let ck_member=;
%Display SELECT;

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now