![SMARTTECH](/img/default-banner.jpg)
- 179
- 463 410
SMARTTECH
United States
Registrace 12. 01. 2007
Major advantage of a lookup table over hard coded values
Major advantage of a lookup table over hard coded values
zhlédnutí: 229
Video
Understanding length while using cat functions and taking appropriate action
zhlédnutí 156Před měsícem
Understanding length while using cat functions and taking appropriate action
WARNING: Variable id has already been defined as numeric.
zhlédnutí 251Před měsícem
Understanding compilation phase in datastep is important and this video explains explains significance of how variable attributes are set in compilation phase.
How to capture warnings from your SAS Log
zhlédnutí 393Před měsícem
With help of proc printto and _infile_ we can capture specific text from SAS Log. Code for this program is at github.com/kiranvenna/CZcamsproblems_code/blob/master/_infile_.sas.
Understanding Macro variable resolution.
zhlédnutí 220Před 2 měsíci
Understanding Macro variable resolution.
How to run SAS code Dynamically depending on the day of a month
zhlédnutí 448Před 3 měsíci
This video is about how to solve problem where Text generation is needed and how SAS Macro programming helps in text generation. for Macro functions checkout: czcams.com/video/6p3lVnDiJCU/video.html for %if %then checkout out: czcams.com/video/1PeJV5ok-XM/video.html
Avoid redundant code in multiple SAS programs
zhlédnutí 415Před 4 měsíci
Avoid redundant code in multiple SAS programs
Strategies to test and resolve data issues with case When Statements
zhlédnutí 448Před 4 měsíci
Strategies to test and resolve data issues with case When Statements
Look into your SAS logs and debug your code
zhlédnutí 576Před 5 měsíci
Look into your SAS logs and debug your code
Create directory/folder if does not exist while using libname statement
zhlédnutí 363Před 5 měsíci
Create directory/folder if does not exist while using libname statement
Convert a character variable with month and year to end of the month as date in SAS
zhlédnutí 492Před 6 měsíci
Convert a character variable with month and year to end of the month as date in SAS
Solving a problem and Validating/testing your results in SAS.
zhlédnutí 871Před 6 měsíci
Solving a problem and Validating/testing your results in SAS.
How to Avoid: WARNING: Length of character variable Name has already been set.
zhlédnutí 317Před 6 měsíci
How to Avoid: WARNING: Length of character variable Name has already been set.
Are you using retain for ordering variables, be careful.
zhlédnutí 592Před 6 měsíci
Are you using retain for ordering variables, be careful.
How to capture all input datasets and libnames used in a SAS program
zhlédnutí 947Před 6 měsíci
How to capture all input datasets and libnames used in a SAS program
Pick different dataset in your process as per odd/even month number in SAS
zhlédnutí 350Před 8 měsíci
Pick different dataset in your process as per odd/even month number in SAS
Understanding the concept of self Join with an unique example
zhlédnutí 339Před 8 měsíci
Understanding the concept of self Join with an unique example
how to capture row number of observation which has at least one missing value #shorts
zhlédnutí 467Před 8 měsíci
how to capture row number of observation which has at least one missing value #shorts
Quick look of SAS merge vs SAS update statement.
zhlédnutí 386Před 9 měsíci
Quick look of SAS merge vs SAS update statement.
Finding variables with all missing values in a SAS dataset
zhlédnutí 1,2KPřed 9 měsíci
Finding variables with all missing values in a SAS dataset
DATA step if then vs Proc SQL case when statement
zhlédnutí 505Před 9 měsíci
DATA step if then vs Proc SQL case when statement
Understanding in=dataset option in a merge statement
zhlédnutí 550Před 9 měsíci
Understanding in=dataset option in a merge statement
Obtain all end-of-month dates from a start date to an end date
zhlédnutí 542Před 10 měsíci
Obtain all end-of-month dates from a start date to an end date
Creating datasets from each variable in a SAS dataset
zhlédnutí 1,2KPřed 10 měsíci
Creating datasets from each variable in a SAS dataset
Simple shortcuts to do sum on many variables with common prefix and all numeric variables in SAS
zhlédnutí 393Před 10 měsíci
Simple shortcuts to do sum on many variables with common prefix and all numeric variables in SAS
How to avoid overwriting of SAS Macro variables.
zhlédnutí 769Před 11 měsíci
How to avoid overwriting of SAS Macro variables.
How same variables in different datasets in merge statement impacts results
zhlédnutí 1,2KPřed rokem
How same variables in different datasets in merge statement impacts results
Finding observations with all missing values easily in SAS #shorts
zhlédnutí 1,1KPřed rokem
Finding observations with all missing values easily in SAS #shorts
Capture datasets names of appending datasets in SAS
zhlédnutí 703Před rokem
Capture datasets names of appending datasets in SAS
TIL: The forward rescan rule for macros.
I have one question ? Data have; Input sex$ 1.; Cards; F F F F M M M ; Run; How to get output like ---> Sex F M F M F M F ;
how to extract the value of the maximum count sir ??
Please provide simple input and output, i can help you
Excellent explaination sir
I know this video is 3 years old, but I only just recently saw it (randomly looking for tips and tricks in SAS). The 2nd version of the code will not work; there is a logic flaw. The value for NEWVAR in obs 4 will be null. For the 4th iteration, the COUNT variable will still have a value of 2, and it will meet the condition of setting NEWVAR to MONTH4, overwriting the original 'C' from MONTH3. The original version of the code is the correct way. Just thought I'd mention that in case anyone else is still watching this in 2024.
Very nice tutorial! A couple of important points you didn’t mention: 1. When you use NODUPKEY to remove some records, it keeps the first record in the data (or last one using DESCENDING option before BY variable). If you want to keep different ones, you need to do some manipulation of the data. 2. When you use all variables after NODUPKEY, It’s an equivalent of using NODUP.
Awesome technique Sir, extraordinary stuff of yours in SAS programming.
Sir, how do we fix the length if the variable length is differing?
Pick the length of variable where it is max. Avoid datastep and use Proc SQL (if possible) whenever you cannot max length of variable.
@@kiranvenna thanks much ❤️
Sir thank you for sharing but to do proper merging or joining we need as first explained id, age ,salery 3 records but not should not show the age proper output
Hi, I did not completely understand your question.
I am asking that if the loglines are there how it will merge... Please
Thank you so much sir ❤❤ Appreciate your efforts and knowledge 🙏🙏
Super sir as share your knowledge 🙏
Please create complete etl tutorial with sas.
can anyone help to get a free version of sas base
you can SAS on demand for academics for free. It is free for everyone. www.sas.com/en_ca/software/on-demand-for-academics.html
How to contact you
please contact us at smarttech089@gmail.com.
Example :-It helps to Print 1st obs 4 times 4th obs 2 times 19th obs 6 times l
Way of explanation is excellent sir
Thank you, sir, for this video, it's very helpful
Sir make series on interview questions in sas🙏
check this playlist, this has some interview based question and answers. czcams.com/video/ISZ4Gf6_hdU/video.html
Thanks this was very helpful, keep up the good work!!!!!
Link is not able to open sir. Please look into it and do needful
Thank you for letting me know. Now fixed it.
Thank you Sir
Please make vedio on Diffrrence between Libname and pass thru query in points wise which functions not work in pass thru query
Please checkout this video. czcams.com/video/NakCmdSkGjg/video.html
@@kiranvenna 🙏🙏
Sir i have a question suppose we have 3 different id with multiple observations. And i want to impute missing value with their mean vallue then how can we do that. for each id mean value will be different.
Please give me a sample input and output.
For numeric missing we can use nmiss in proc means too right?
In proc means nmiss number of missing values for each variable. In our example we are trying to find missing values by observation.
Please do more short videos sir
Sure. few more are coming soon.
I am sorry you had to delete my comment. It was just an idea for a video. I'll unsubscribe do i don't mistakenly post another comment.
I did not delete your comment. Why would I will delete your comment. In fact always love your comments. Please feel to comment anything. Not sure what you commented earlier, please feel free to comment. In fact if you have an idea, I would love it.
Salute you sir.
Superb sir, I have learn lots of logic building from your channel.
Thank you
Thank you 👍🏻 for this video
Please clarify how the consecutive missing values in the middle were (for E id) are not counted with the both the ways? And what if we need to consider this scenario also?
if we want to every consecutive values then we should count from beginning and we should apply logic in such a way that if we find a missing value followed by missing value then we should not count or if last value is only missing value we should not count. please check the logic below. data have; input @1 id:$3. var1-var12; cards; A 1 2 3 . . . . . 1 1 1 3 B . 3 2 1 3 2 1 . . . . . C . . . . 1 2 3 1 2 3 2 . D 3 . 1 . 3 . 1 . 3 . 1 . F 1 3 . . 1 3 . . 1 3 . . E 3 2 1 . . . . . 1 1 1 3 G 3 3 2 1 3 2 1 . . . . . H . . 1 3 3 1 2 3 1 2 . . I 3 . 1 . 3 . 1 . 3 . 1 . J . . . . . . . . . . . . ; run; data want; set have; array nu(12) var1--var12; count_consq=0; do i=1 to 12; if nu{i}=. then count_consq=count_consq+1; if count_consq= 1 and (nu{i} ne . or i=12) then count_consq= 0; end; drop i; run;
@@kiranvenna hello, thank you for this video. using the code above, do you know how I can include a count of 2-5 consecutive values over a threshold (example: values >55 minutes)?
I tried %let dsn=sashelp.class; and then trying to apply proc sort (PROC SORT DATA=&dsn ; BY SEX; RUN;)step its not working why? do u have any idea ?
What is the error message. Check the error message. This helps us to understand things better. Always run code without macro variables first and see what happens. If you do proc sort data=sashelp.class; run:. Clue that will not work either and why it will not work and why it does not work. It will be in your log
Sir, kindly create a video on symmetry macro function.
I have never heard about that.
Clever! Thank you!!! I run into this problem at least twice a week.
Is there a way to group variable and then use lag function so that one id value does not go to second id.
Once you are done with lag function in which you have lag from from one id to another. All you need to say is . if first.id then newcolumn= .
Thank you sir for such a helpful video.
Hi Sir..Thanks for posting videos. I am learning macros and I have a doubt regarding %global statement. Could you plz clarify. %macro win; %global name country; %let name=Sunny; %let country=India; %MEND Win; But I am unable to resolve the macro variables. Pls help me on this and Thanks in Advance!
to resolve macro variable you need to use %put &name &country; %global makes macro variables accessible to the whole sas session other wise they are avaiable only for that particular macro. Please checkout my video on scope of SAS macro variables to understand more about %global. czcams.com/video/qVfu_hvhXaA/video.html&pp=ygUPc2FzIG1hY3JvIHNjb3Bl
If i want to assign the smaller length than the existing length in dataset in that case we will get a warning even if we give before the set statement
Yes it will give warning in log like multiple length were specified for given particular variable, and again it will change the length for given particular variables.
Thanks for the quick explanation . Is there any alternative way to do that except doing in another data step?
Attrib or length statement before set statement should work.
This is ingenious! Thank you!!!!
If you use the implicit method you can use the name you give the connection in your join sections. If you use the pass through method, you have to use the schema name for the joins. Also if you are using pass through you have to be aware of what kind of database you are connecting to and which functions it supports. the SAS datetime function will not work in a POSTGRESQL passthrough but will work in a ORACLE passthrough, you would have to do something like "cret_dt::timestamp::date" instead of datetime(cret_dt) for POSTGRESQL. However in a implicit connection, you can use all of the SAS built-in functions since its not an instance in another database. Amazing video.
Thank you and correct observation.
Does select statement works before than having statement?? Generally excution order from -where -group by- having- select - order by. By using having clause with new variable , you have filtered the data . As per order select works after having. Then when you use calculated variable it's working how . Please help me...
Can you me a specific example. Select works after having clause.
Thankyou so much sir.
How can i get vaccancy information
Please see in job portals or people whom you know who work in industries.
Very informative sir❤
Sir, we can do this by using an Array as well. right? If yes, then please explain by using an array statement as well. One more request is to please do a topic on Hash objects, rsubmit programs. Thank you for providing practical scenarios.
Yes we can and similar(not same ) video with array concept is czcams.com/video/RwbsnYUyP1w/video.html. Will try to work on hash objects sometime in future. Appreciate your comments
Very useful. Never imagined the same table could be self-joined or that the ON variable could be set as negative!
Thank you 🙏
Thank you for the video. It would be good if you could share the SAS Code so that we can try and experience it
SAS code at this link. github link for this code at github.com/kiranvenna/CZcamsproblems_code/blob/master/variableswithallmissingvalues.sas
Can you show one scenario where to create a table in proc sql add a column which can be blank
you mean why do we need new column with blank after sometime of creating table. Is that is what your doubt is
@@kiranvenna no I just need example to add a new column in table which can be blank like a student table add a new column student name which can be blank.
Sir where is notes in description
This was written in the description. I am making this video as someone has asked this question. This is more of interview type answer than real world scenario. Proc SQL does not have features to do this kind of problem solving. This are more easily solved using a data step or proc rank. Also whenever we use outobs option we will see WARNING: Statement terminated early due to OUTOBS=3 option in the log. For any queries please contact us at smarttech089@gmail.com.
@@kiranvenna Thank you sir your vedios very useful
I love this one! I've tended to avoid using into with proc SQL, but I'll give it a whirl now. Thanks a million!