Solved

Inputting a macro variable from an external file

Posted on 2013-01-16
6
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

737 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