Data is provided directly in the code via the DATALINES statement and read with the line-hold operator '@@'.
1 Code Block
DATA STEP Data
Explanation : Creation of the 'CEIL_DATA' table. The 'input a @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;' statement continuously reads variables from the data lines. The 'ceil(a)' function returns the smallest integer greater than or equal to 'a', and 'floor(a)' returns the largest integer less than or equal to 'a'.
Copied!
DATA CEIL_DATA;
input a @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
b=ceil(a);
c=floor(a);
datalines;
1.5 -2.4 3.1 -45.7 76.8 -33.9 86.2 -567.4 -34.6 342.3
;
1
DATA CEIL_DATA;
2
INPUT a @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
3
b=ceil(a);
4
c=floor(a);
5
DATALINES;
6
1.5 -2.43.1 -45.776.8 -33.986.2 -567.4 -34.6342.3
7
;
2 Code Block
PROC PRINT
Explanation : Displays the content of the 'CEIL_DATA' table, showing the original value, its ceiling value (ceil) and its floor value (floor).
Copied!
PROC PRINT DATA=CEIL_DATA;
var a b c;
RUN;
QUIT;
1
PROC PRINTDATA=CEIL_DATA;
2
var a b c;
3
RUN;
4
QUIT;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.