I have used If first. and last. options in data step.
But, couldn't find any similar options in proc sql.
Please provide me the solution for this issue.
These options do not exist in PROC SQL.
They exist in DATA steps.
Thus, if you need to use these options, you would use a DATA step and not PROC SQL.
Use both! You will twice as efficient!
I believe @PGStats comment nailed it.
Having said that: Some database SQL extensions provide "first" and "last" as analytics functions http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions056.htm ... but then: They don't have the SAS data step and implementing the same with PLSQL can be painful.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.