The following code works for my purpose. I was trying to convert SAS tables into Oracle tables, since tables are named following certain rules, I was able to use loops to reduce my labor. I have applied two "data _null_' steps to insert values into the Macro variables I need in downstream data step. I am new to Macro in general, so My gut told me there must be better practices out there. Please advise.
libname upload oracle user='xxx' password='xxx' path='xxx';
%DO TYPE=1 %TO 3;
DATA _NULL_;*first one, to put value into macro variable TP;
CALL SYMPUTX ("TP",PUT(&TYPE,$TP.));
%do level=1 %to 4;
DATA _NULL_; *second one, to put values to variable LE and LE_ID;
CALL SYMPUTX ("LE",PUT(&LEVEL, $LV.));
CALL SYMPUTX ("LE_ID", PUT (&LEVEL, $LV_ID.));
data upload.CPM_&TP._&LE._&dt. ;
Email messages cannot be guaranteed to be secure or error-free as
transmitted information can be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
Centers for Medicare & Medicaid Services therefore does not accept
liability for any error or omissions in the contents of this
message, which arise as a result of email transmission.
CONFIDENTIALITY NOTICE: This communication, including any
attachments, may contain confidential information and is intended
only for the individual or entity to which it is addressed. Any
review, dissemination, or copying of this communication by anyone
other than the intended recipient is strictly prohibited. If you
are not the intended recipient, please contact the sender by reply
email and delete and destroy all copies of the original message.