enterprise-guide

How do you add a row Number in SAS by multiple groups with one variable in decending order?

扶醉桌前 提交于 2021-01-29 09:28:40
问题 I have discovered this code in SAS that mimics the following window function in SQL server: ROW_NUMBER() OVER (PARTITION BY Var1,var2 ORDER BY var1, var2) = data want; set have by var1 var2; if first.var1 AND first.var2 then n=1; else n+1; run; "She's a beaut' Clark"... but, How does one mimic this operation: ROW_NUMBER() OVER (PARTITION BY Var1,var2 ORDER BY var1, var2 Desc) I've made sure I have before: PROC SORT DATA=WORK.TEST OUT=WORK.TEST; BY var1 DECENDING var2 ; RUN; data WORK.want;

Download JSON File from API via Proxy using SAS EG

China☆狼群 提交于 2021-01-29 07:41:08
问题 I am trying to geocode adresses from within a company network using an API from the Swiss authorities. My company uses proxy servers with usernames and passwords. I am new to SAS EG and this is the code that I have so far (i had to anonymize some things in order to be allowed to post this here): filename response temp; options set=SSL_USE_SNI=1; options set=SSL_SNI_HOSTNAME="api3.geo.admin.ch"; proc http url = 'https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=Bahnhofstrasse

Convert Date to String in SAS data step monyy5. to yymmn6

雨燕双飞 提交于 2020-01-14 05:23:11
问题 In SAS EG, in a data step, I am trying to convert from a date to a string in the following formats: JUN18 to '201806' I am able to convert the opposite direction using a data step as follows: data date; length b $6; b='201806'; new_b=input(b, yymmn6.); format new_b monyy5.; The result is that new_b = JUN18 . I have tried the opposite direction and something is just off and I can't figure out what I am missing. Does anyone know how to convert these data types? Thanks. 回答1: Use the PUT or PUTN

how to list all available user defined macros in SAS Enterprise Guide?

荒凉一梦 提交于 2020-01-02 05:43:05
问题 Say in my main code I have this code block: %macros hi5; %put hi five; %mend; %macros helloworld; %put hello world; %mend; How do I, in SAS Enterprise Guide, display something like this? (via log or via a SAS table) These are the user defined user macros: hi5 hello world (the aim is so that user is able to know what macros are already available to them). Note: the %put _ALL_ only list all macros variables, not macros (e.g. built with %macros and %mend .) 回答1: You can get there via PROC

Automatic parameter and definition display for macro functions in SAS EG

家住魔仙堡 提交于 2019-12-13 03:49:56
问题 In SAS EG there is a neat feature that allows one to see the parameters of a macro function and its definitions when typing. For example if I execute: %macro test (a /* this is a */ ,b /* this is b */ ); %put a b; %mend; And then type %test( , a popup will show me "a : this is a" etc... Unfortunately for some reason it seems to work only IF the macro function was defined in the current program (so basically in the only place where you don't really need it, as in that case it should be quite

Get server info for all librefs

吃可爱长大的小学妹 提交于 2019-12-08 05:30:14
问题 How can I get a table with variables libref and server_id (or any server info) for all libraries available to me in SAS ? My goal is to get a summary of where the data is physically located for all these libraries, in order to write efficient queries when fetching data from different servers. 回答1: Look at what information is available in the view SASHELP.VLIBNAM (or DICTIONARY.LIBNAMES when using PROC SQL). Here is a utility macro that pulls the engine, host and schema from that view for a

Get server info for all librefs

五迷三道 提交于 2019-12-06 14:42:38
How can I get a table with variables libref and server_id (or any server info) for all libraries available to me in SAS ? My goal is to get a summary of where the data is physically located for all these libraries, in order to write efficient queries when fetching data from different servers. Look at what information is available in the view SASHELP.VLIBNAM (or DICTIONARY.LIBNAMES when using PROC SQL). Here is a utility macro that pulls the engine, host and schema from that view for a given libref. I have used it for TERADATA, ORACLE and ODBC engines. dblibchk.sas From Tom's code and advices I

how to list all available user defined macros in SAS Enterprise Guide?

怎甘沉沦 提交于 2019-12-05 15:06:50
Say in my main code I have this code block: %macros hi5; %put hi five; %mend; %macros helloworld; %put hello world; %mend; How do I, in SAS Enterprise Guide, display something like this? (via log or via a SAS table) These are the user defined user macros: hi5 hello world (the aim is so that user is able to know what macros are already available to them). Note: the %put _ALL_ only list all macros variables, not macros (e.g. built with %macros and %mend .) You can get there via PROC CATALOG , or via dictionary.catalogs . The latter will work even if you don't know where they're stored. proc sql;

Tell SAS not to add newly generated tables on the Process Flow

情到浓时终转凉″ 提交于 2019-12-03 17:23:00
问题 I have a SAS code that creates a lot of intermediary tables for my calculations. Thing is, I don't really care about this tables after the job is done, I only care to the finals results. But, everytime I run this code, SAS add all the generated tables do my process flow, turning it into a huge mess (I am talking here of 40+ intermediary tables). Is there a way to tell SAS not to add some tables to the process flow? Or at least to tell it not to add any tables at all? I am using SAS Enterprise

Tell SAS not to add newly generated tables on the Process Flow

人盡茶涼 提交于 2019-12-03 06:10:58
I have a SAS code that creates a lot of intermediary tables for my calculations. Thing is, I don't really care about this tables after the job is done, I only care to the finals results. But, everytime I run this code, SAS add all the generated tables do my process flow, turning it into a huge mess (I am talking here of 40+ intermediary tables). Is there a way to tell SAS not to add some tables to the process flow? Or at least to tell it not to add any tables at all? I am using SAS Enterprise Guide 4.1 Thanks in advance sasfrog Under SAS 9.1.x and 9.2.x (for Windows), it's possible to suppress