Explanation: To create temporary array elements, specify _TEMPORARY_ after the array name and dimension. Specify an initial value for each element, separated by either blanks or commas, and enclose the values in parentheses.
Arrays in the SAS language are different from arrays in many other languages. A SAS array is simply a convenient way of temporarily identifying a group of variables. It is not a data structure, and array-name is not a variable.
An ARRAY statement defines an array. An array reference uses an array element in a program statement. To create a temporary array, use the _TEMPORARY_ argument. The following example creates a temporary array named TEST: options nodate pageno=1 linesize=80 pagesize=60;
data score2(drop=i); array test{3} _temporary_ (90 80 70); array score{3} s1-s3; input id score{*}; do i=1 to 3; if score{i}>=test{i} then do; NewScore=score{i}; output; end; end; datalines; 1234 99 60 82 5678 80 85 75 ;
proc print noobs data=score2; title 'Data Set SCORE2'; run;
Question : Based on the ARRAY statement below, select the array reference for the array element hadoop. array hadoopexam{,} hadoop-hadoop; 1. hadoopexam{hadoop50} 2. hadoopexam{1,50} 3. Access Mostly Uused Products by 50000+ Subscribers 4. hadoopexam{3,0}
Explanation: This two-dimensional array would consist of three rows of 25 elements. The first row would contain hadoop1 through hadoop25, the second row would start with hadoop26 and end with hadoop50, and the third row would start with hadoop51 and end with hadoop75.
To create a multidimensional array, place the number of elements in each dimension after the array name in the form {n, ... } where n is required for each dimension of a multidimensional array. From right to left, the rightmost dimension represents columns; the next dimension represents rows. Each position farther left represents a higher dimension. The following ARRAY statement defines a two-dimensional array with two rows and five columns. The array contains ten variables: five temperature measures (t1 through t5) from two cities (c1 and c2): array temprg{2,5} c1t1-c1t5 c2t1-c2t5; SAS places variables into a multidimensional array by filling all rows in order, beginning at the upper-left corner of the array (known as row-major order). You can think of the variables as having the following arrangement: c1t1 c1t2 c1t3 c1t4 c1t5 c2t1 c2t2 c2t3 c2t4 c2t5
Question :
Given the contents of the raw data file EMPLOYEE: ----|----10----|----20----|----30 Amit 19/2/2004 ACCT Rohit 22/5/2004 MKTG Manglesh 14/3/2004 EDUC The following SAS program is submitted:
data emps; infile 'employee'; input@1 name$ @15 date (insert INFORMAT here) @25 department$; run;
17oct91 ddmonyy DATETIMEw.d date and time: ddmonyy:hh:mm:ss 17oct91:14:45:32 DDMMYYw. day, month, year: ddmmyy, dd/mm/yy, 17/10/91 dd-mm-yy, or dd mm yy JULIANw. year and day of year (Julian dates): yyddd
91290 MMDDYYw. month, day, year: mmddyy, mm/dd/yy, 10/17/91 mm-dd-yy, or mm dd yy MONYYw. month abbreviation and year Oct91 NENGOw. Japanese Nengo notation H.03/10/17 TIMEw.d hours, minutes, seconds: hh:mm:ss 14:45:32 or hours, minutes: hh:mm. WEEKVw. ISO 8601 year, week, day of week: yyyy-Www-dd 1991-W42-04 YYMMDDw. year, month, day: yymmdd, yy/mm/dd, 91/10/17 yy-mm-dd, or yy mm dd YYQw. year and quarter of year: yyQq 91Q4