datastep

proc sql vs data step for looking up values form a reference table that includes exceptions

谁说我不能喝 提交于 2019-12-02 10:12:48
问题 I am trying to find out tax values for a particular good in a particular city in a particular state. Tax values are in a reference table like this: state city Good tax --------------------------------- all all all 0.07 all all chicken 0.04 all jackson all 0.01 arizona all meat 0.02 arizona phoenix meat 0.04 arizona tucson meat 0.03 hawaii all all 0.08 nevada reno cigar 0.11 nevada vegas cigar 0.13 Now lets say if I am looking for tax for (nevada reno cigar) an exact match exists in the

sas execute a macro for each instance in a data step

倾然丶 夕夏残阳落幕 提交于 2019-12-02 07:46:41
I have a macro which inserts data into a table over a set of given time-frame. It loops through a series of from-to dates (which are stored in a dataset) and runs the macro with a proc sql insert statement. When checking the data at the end of all of this, I notice that only data from the final from-to period is in the new data set. Here is my code when calling the macro in the data step. data _null_; set extract_insert_dates; %insert_table_extract(put(extract_start, date11.),put(extract_end, date11.)); run; Is there something else I should be calling in the data step for this to work and

proc sql vs data step for looking up values form a reference table that includes exceptions

孤者浪人 提交于 2019-12-02 03:26:16
I am trying to find out tax values for a particular good in a particular city in a particular state. Tax values are in a reference table like this: state city Good tax --------------------------------- all all all 0.07 all all chicken 0.04 all jackson all 0.01 arizona all meat 0.02 arizona phoenix meat 0.04 arizona tucson meat 0.03 hawaii all all 0.08 nevada reno cigar 0.11 nevada vegas cigar 0.13 Now lets say if I am looking for tax for (nevada reno cigar) an exact match exists in the reference so the answer is 0.11. But, if I look for (nevada reno chicken) an exact match does not exist, but

Express “PUT all variables” in a data step to export SAS data

和自甴很熟 提交于 2019-12-01 23:32:39
问题 Goal: export an entire SAS dataset to a tab-delimited text file using a data step. Problem: In every example that I can find, such as this one, one must specify every variable in the data step following the PUT statement. Isn't there a simple method to just ask for "all" of the variables? I have already tried using PUT _ALL_ , but that includes the variable names in every row of the output, instead of just outputtin the values. 回答1: If you want to do it in a data step, AND don't want to

Express “PUT all variables” in a data step to export SAS data

半腔热情 提交于 2019-12-01 21:31:15
Goal: export an entire SAS dataset to a tab-delimited text file using a data step. Problem: In every example that I can find, such as this one , one must specify every variable in the data step following the PUT statement. Isn't there a simple method to just ask for "all" of the variables? I have already tried using PUT _ALL_ , but that includes the variable names in every row of the output, instead of just outputtin the values. If you want to do it in a data step, AND don't want to specify things, but really don't want PROC EXPORT making decisions for you, AND have data that's reasonably