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
Solved

Inputting a macro variable from an external file

Posted on 2013-01-16
6
336 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

839 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