Could you please guide me understand what each code does? can I understand that technically both the codes are selecting the variables from DB2 table?
select distinct createdbylogonuserid, left(trim(lastname))||' '||left(trim(firstname)) as creator, creator_duser
from connection to db2(
select b.identifier as ......
Another one is,
select * from connection to db2(
select x.policyinstanceid , x.customerID, y.value as client_segment
What do you want explained, it seems to be as basic as it gets. First one is creating a distinct list of strings with the two parts and a space. The second selects from variables.
In first code, connect to db2 statement comes after the selection of variables whereas in other code, connect to db2 statement comes before selection of variables
They are much the same, you can use either, refer to the documentation:
http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001348730.htm
You can only select from in the these mostly, and possibly insert into, but for other operations you will want a third type of syntax which is: execute by db (...);
One thing that is difference is that the first code selects a users list of variables and the second code selects all variables in the table.
while the 2 codes may provide the same information, it is hard to tell with not sample data tables for this code.
another difference is the enter selection which is incomplete in the sample are different.
These 2 codes may provide the same results but user beware.
Know your data, we were given no data to evaluate.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.