×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Macro Question

Macro Question

Macro Question

(OP)
I have a table that has a Character field that I am trying to insert a macro into:
The macros are

%let blending1 = INDIES15;
%let blending2 = SUPERCHAINS15;
%let blending3 = INDIES13;
%let blending4 = STORES14;

The table is
execute (create table ACCESS_DENSITY_ADV_NETWORK (ATTRIBUTE_ROW char(60), AVAILABLE_PHARMACIES integer,
NETWORK_PHARMACIES integer, BLENDING1 integer, BLENDING2 integer, BLENDING3 integer,BLENDING4 integer)) by odbc;


execute (insert into ACCESS_DENSITY_ADV_NETWORK
select "21: BLENDING1 &BLENDING1", 0, 0, 0 ,0 ,0 ,0)  by odbc;
execute (insert into ACCESS_DENSITY_ADV_NETWORK
select "22: BLENDING2 &BLENDING2", 0, 0, 0 ,0 ,0 ,0)  by odbc;
execute (insert into ACCESS_DENSITY_ADV_NETWORK
select "23: BLENDING3 &BLENDING3", 0, 0, 0 ,0 ,0 ,0)  by odbc;
execute (insert into ACCESS_DENSITY_ADV_NETWORK
select "24: BLENDING4 &BLENDING4", 0, 0, 0 ,0 ,0 ,0)  by odbc;

the macro will not resolve unless I put them in double quotes when I insert into the table, but if I do, it will not insert and gives me the following error
ERROR: CLI execute error: [NCR][Teradata RDBMS] Cannot resolve column '22: BLENDING2 SUPERCHAINS15'. Specify table or view.

Any suggestions will be appreciated



Michael

RE: Macro Question

Try this:

%let blending1 = 'INDIES15';
execute (insert into ACCESS_DENSITY_ADV_NETWORK
select '21: BLENDING1 ' || &BLENDING1, 0, 0, 0 ,0 ,0 ,0)  by odbc;

or
%let blending1 = '21: BLENDING1 INDIES15';
execute (insert into ACCESS_DENSITY_ADV_NETWORK
select &BLENDING1, 0, 0, 0 ,0 ,0 ,0)  by odbc;

SAS would not resolve your macro in single quotes, and your database only take single quotes for string field.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close