//
archives

SAS NEWS

This category contains 14 posts

Why this Google engineer gave up on Silicon Valley and moved back to India


By all accounts, including her own, Nupur Dave had the dream life.

A native of India, she had spent the past decade living in the US. She was working at Google at the perk-filled “Googleplex” headquarters in Mountain View, California, at a job she loved. And she had obtained a permanent residence, her green card.

She was a manager for a part of Google called Network Content Distribution, the network tech that makes Google run faster (in geek speak: it’s Google’s homegrown alternative to a content distribution network like Akamai).

http://www.businessinsider.in/why-this-google-engineer-gave-up-on-silicon-valley-and-moved-back-to-india/articleshow/57707322.cms

Advertisements

Top Analytics/Data Science Tools


R remains the leading tool, with 49% share, but Python grows faster and almost catches up to R. RapidMiner remains the most popular general Data Science platform. Big Data tools used by almost 40%, and Deep Learning usage doubles.Top tools

For More Details visit :

http://www.kdnuggets.com/2016/06/r-python-top-analytics-data-mining-data-science-software.html

Free eBooks from Microsoft Press for data science.


The world around us—every business and nearly every industry—is being transformed by technology. SQL Server 2016 was built for this new world and to help businesses get ahead of today’s disruptions. With this free ebook, learn to install, configure, and use Microsoft’s SQL Server R Services in data science projects. R is one of the most popular, powerful data analytics languages and environments in use by data scientists.

https://mva.microsoft.com/ebooks/

Sitworld Analytics Team

Here are 5 examples of quick keystrokes that can save you time.


Convert case
Convert selected text to upper case: Ctrl + Shift + U
Convert selected text to lower case: Ctrl + Shift + L

Quick commenting
Wrap selection (or current line) in a comment: Ctrl + /
Unwrap selection (or current line) from a comment: Ctrl + Shift + /

Hyperjump to a line
Go to line: Ctrl + G (prompts for a line number)
Be sure to turn on Show line numbers in Program->Editor Options, or you’ll be navigating blind!

Jump to the “end of scope”
Move caret to matching parenthesis/brace: Ctrl + [, Ctrl + ]
Move caret to matching DO/END keyword: Alt + [, Alt + ]

RECFM=V,LRECL=256


From the SAS Online Doc:

RECFM= specifies the record format. Values for the RECFM= option are

      D =default format (same as variable).

      F =fixed format. That is, each record has the same length. Do not use
RECFM=F for external files that contain carriage-control characters.

      N =binary format. The file consists of a stream of bytes with no
record boundaries.

      P =print format. On output, the SAS System writes carriage-control
characters.

      V =variable format. Each record ends in a newline character.

      S370V variable S370 record format (V).

      S370VB variable block S370 record format (VB).

      S370VBS variable block with spanned records S370 record format (VBS).
If you specify RECFM=S3270VBS, then you should specify BLDSIZE=32760 and
LRECL=32760 to avoid errors with records longer than 255.

Note:   To use the S370V, S370VB, or S370VBS format to access a file that
was created under the OS/390 operating environment, the file must be of type
RECFM=U.

This option is used for both input and output.

Copying SAS Data Sets between Hosts


Introduction:

Proc copy is used to copy or move data from one library to another library.

Feature:

1. It can use to move all data from one library to another.

2. It can also use to move particular dataset from particular library to another.

3. It also can be use to move one particular data type also.

Syntax:

Proc copy

If any help reply me back….

SAS auto round figure if more that 18 digit


We notice SAS base will round the figure is more than 18 digit.

Is there any setting in server/client machine if we want to programmer to show exact value?

Below is the sample code:

data test;

format b best32.;

format d best32.;

format f best32.;

x = ‘0010000000130000123’;

y = ‘001000000013000012’;

z = ‘00100000001300001’;

len1 = length(x);

len2 = length(y);

len3 = length(z);

b = input(x, best32.);

d = input(y, best32.);

f = input(z, best32.);

run;

Another Program :

data test68;
format b best32.;
x = ‘0010000000130000123’;
len1 = length(x);
b = input(x, best32.);
run;

Regards,

SAS INDIA

SAS Global Certification Program


SAS Certifications

 

Regards,

SAS INDIA

SAS Functions


OPTIONS NODATE NONUMBER PS=58 LS=80;

/* Page 1 */
/* How Lengths of Character Variables are Set in a SAS Data Step */
/* #1 */
DATA chars1;
    FILE print;
	string = 'abc';
	length string $ 7;  /* Does this do anything */
	storage_length = lengthc(string);
	display = ":" || string || ":";
	put storage_length= ;
	put display= ;
RUN;

/* Page 2 */
/* #2 */
DATA chars2;
    FILE print;
	length string $ 7;  /* Does this do anything */
	string = 'abc';
	storage_length = lengthc(string);
	display = ":" || string || ":";
	put storage_length= ;
	put display= ;
RUN;

/* Converting Multiple Blanks to a Single Blank */
/* #3 */
DATA multiple;
    INPUT #1 @1  name    $20.
          #2 @1  address $30.
		  #3 @1  city    $15.
             @20 state    $2.
             @25 zip      $5.;
    name = compbl(name);
	address = compbl(address);
	city = compbl(city);
DATALINES;
Ron Cody
89 Lazy Brook Road
Flemington         NJ    08822
Bill     Brown
28   Cathy   Street
North   City       NY    11518
;
RUN;

PROC PRINT data = multiple NOOBS;
    TITLE 'The multiple data set';
    ID name;
	VAR address city state zip;
RUN;

/* Page 3 */
/* How to Remove Characters from a String */
/* #4 */
DATA phone;
    INPUT phone $ 1-15;
	phone1 = compress(phone);
	phone2 = compress(phone,'(-) ');
DATALINES;
(908)235-4490
(201) 555-77 99
;
RUN;

PROC PRINT data = phone NOOBS;
    TITLE 'The phone data set';
RUN;

/* Page 4 */
/* Character Data Verification */
/* #5 */
DATA verify;
    INPUT @1  id $3.
          @5  answer $5.;
    position = verify(answer,'abcde');
DATALINES;
001 acbed
002 abxde
003 12cce
004 abc e
;

PROC PRINT data = verify NOOBS;
    TITLE 'The verify data set';
RUN;

/* #6 */
DATA trailing;
    length string $ 10;
	string = 'abc';
	pos1 = verify(string,'abcde');
    pos2 = verify(trim(string),'abcde');
RUN;

PROC PRINT data = trailing NOOBS;
    TITLE 'The trailing data set';
RUN;

/* Page 5 */
/* Substring Example */
/* #7 */
DATA pieces_parts;
    INPUT id $ 1-9;
	length state $ 2;
	state = substr(id,1,2);
    num = input(substr(id,7,3),3.);
DATALINES;
NYXXXX123
NJ1234567
;
RUN;

PROC PRINT data = pieces_parts NOOBS;
    TITLE 'The pieces_parts data set';
RUN;

/* Page 6 */
/* Using the SUBSTR Function on the Left-Hand Side of the Equal Sign */
/* #8 */
DATA pressure;
     INPUT sbp dbp @@;
	 length sbp_chk dbp_chk $ 4;
	 sbp_chk = put(sbp,3.);
     dbp_chk = put(dbp,3.);
	 if sbp gt 160 then substr(sbp_chk,4,1) = '*';
	 if dbp gt  90 then substr(dbp_chk,4,1) = '*';
DATALINES;
120 80 180 92 200 110
;
RUN;

PROC PRINT data = pressure NOOBS;
    TITLE 'The pressure data set';
RUN;

/* Page 7 */
/* Unpacking a String */
/* #9 */
DATA pack;
     INPUT string $ 1-5;
DATALINES;
12345
8 642
;
RUN;

DATA unpack;
    SET pack;
	array x[5];
	DO j = 1 to 5;
	    x[j] = input(substr(string,j,1),1.);
	END;
	DROP j;
RUN;

PROC PRINT data = unpack NOOBS;
    TITLE 'The unpack data set';
RUN;

/* Parsing a String */
/* #10 */
DATA parse;
     INPUT long_str $ 1-80;
	 array pieces[5] $ 10 piece1-piece5;
	 do i = 1 to 5;
	     pieces[i] = scan(long_str,i,',.! ');
     end;
     drop long_str i;
DATALINES;
this line,contains!five.words
abcdefghijkl xxx yyy
;
RUN;

PROC PRINT data = parse NOOBS;
    TITLE 'The parse data set';
RUN;

/* Page 8 */
/* Using the SCAN function to Extract a Last Name */
/* #11 */
DATA first_last;
     INPUT @1  name  $20.
	       @21 phone $13.;
     *** The next statement extracts the last name from name;
	 last_name = scan(name,-1,' ');    /* scans from the right */
DATALINES;
Jeff W. Snoker        (908)782-4382
Raymond Albert        (732)235-4444
Alred Edward Newman   (800)123-4321
Steven J. Foster      (201)567-9876
Jose Romerez          (516)593-2377
;
RUN;

PROC REPORT data = first_last NOWINDOWS;
    TITLE 'Names and Phone Numbers in Alphabetical Order (by Last Name)';
    COLUMNS name phone last_name;
	DEFINE last_name / order noprint width = 20;
	DEFINE name      / display 'Name' left width = 20;
	DEFINE phone     / display 'Phone Number' width = 13 format=$13.;
RUN;

/* Page 9 */
/* Locating the Position of One String within Another String */
/* #12 */
DATA locate;
    INPUT string $ 1-10;
	first   = index(string,'xyz');
	first_c = indexc(string,'x','y','z');
DATALINES;
abcxyz1234
1234567890
abcx1y2z39
abczzzxyz3
;
RUN;

PROC PRINT data = locate NOOBS;
    TITLE 'The locate data set';
RUN;

/* Changing Lower Case to Upper Case and Vice Versa */
/* Page 10 */
/* #13 */
DATA up_down;
     length a b c d e $ 1;
     INPUT a b c d e x y;
DATALINES;
M f P p D 1 2
m f m F M 3 4
;
RUN;

DATA upper;
    SET up_down;
	array all_c[*] _character_;
	DO i = 1 to dim(all_c);
	    all_c[i] = upcase(all_c[i]);
	END;
	DROP i;
RUN;

PROC PRINT data = upper NOOBS;
    TITLE 'The upper data set';
RUN;

/* Converting String to Proper Case */
/* #14 */
DATA proper;
     INPUT Name $40.;
	 propname = propcase(Name);
DATALINES;
rOn coDY
the tall and the short
the "%$#@!" escape
;
RUN;

PROC PRINT data = proper NOOBS;
    TITLE 'The proper data set';
RUN;

/* Page 11 */
/* Substituting One Word for Another in a String */
/* #15 */
DATA convert;
     INPUT @1 address $20.;
	 *** Convert Street, Avenue, and Road 
	     to their abbreviations;
	 address = tranwrd(address,'Street','St.');
	 address = tranwrd(address,'Avenue','Ave.');
	 address = tranwrd(address,'Road','Rd.');
DATALINES;
89 Lazy Brook Road
123 River Rd.
12 Main Street
;
RUN;

PROC PRINT data = convert;
    TITLE 'The convert data set';
RUN;

/* Fuzzy Merging: The SPEDIS Function */
/* Page 12 */
/* #16 */
DATA compare;
     length string1 string2 $ 15;
	 INPUT string1 string2;
	 points = spedis(string1, string2);
DATALINES;
same same
same sam
firstletter xirstletter
lastletter lastlettex
receipt reciept
;
RUN;

PROC PRINT data = compare NOOBS;
    TITLE 'The compare data set';
RUN;

/* Demonstrating the "ANY" Functions */
/* #17 */
DATA find_alpha_digit;
     input string $20.;
	 first_alpha = anyalpha(string);
     first_digit = anydigit(string);
DATALINES;
no digits here
the 3 and 4
123 456 789
;
RUN;

PROC PRINT data = find_alpha_digit NOOBS;
    TITLE 'The find_alpha_digit data set';
RUN;

/* Page 13 */
/* Demonstrating the "NOT" Functions */
/* #18 */
DATA data_cleaning;
     input string $20.;
	 only_alpha = notalpha(trim(string));
     only_digit = notdigit(trim(string));
DATALINES;
abcdefg
1234567
abc123
1234abcd
;
RUN;

PROC PRINT data = data_cleaning NOOBS;
    TITLE 'The data_cleaning data set';
RUN;

/* Page 14 */
/* The New Concatenation Functions */
/* #19 */
DATA join_up;
     length cats $ 6 catx $ 17;
	 string1 = 'ABC   ';
	 string2 = '   XYZ   ';
	 string3 = '12345';
	 cats = cats(string1, string2);
	 catx = catx('***', string1, string2, string3);
RUN;

PROC PRINT data = join_up NOOBS;
    TITLE 'The join_up data set';
	VAR string1 string2 string3 cats catx;
RUN;

/* The Length, Lengthn, and LengthC Functions */
/* Page 15 */
/* #20 */
DATA how_long;
   one = 'ABC   ';
   two = ' ';   /* character missing value */
   three = 'ABC   XYZ';
   length_one = length(one);
   lengthn_one = lengthn(one);
   lengthc_one = lengthc(one);
   length_two = length(two);
   lengthn_two = lengthn(two);
   lengthc_two = lengthc(two);
   length_three = length(three);
   lengthn_three = lengthn(three);
   lengthc_three = lengthc(three);
RUN;

PROC PRINT data = how_long NOOBS;
    TITLE 'The how_long data set';
RUN;

/* Page 16 */
/* Counting Occurrences of Characters or Substrings Using the
   COUNT and COUNTC Functions */
/* #21 */
DATA Dracula;
    INPUT string $20.;
	count_a_or_b = count(string,'ab');
	countc_a_or_b = countc(string,'ab');
	count_abc = count(string,'abc');
	countc_abc = countc(string,'abc');
	case_a = countc(string,'a','i');
DATALINES;
xxabcxabcxxbbbb
cbacba
aaAA
;
RUN;

PROC PRINT data = Dracula NOOBS;
    TITLE 'The Dracula data set';
RUN;

NOTALPHA function


NOTALPHA function                                        18Jun2001
support: saswss

Searches a character string for a nonalphabetic character and
returns the first position at which any such character is found.

Category: Character

Syntax
   NOTALPHA(string <,start)

Arguments

string
   is the character constant, variable, or expression to search.

start
   is an optional integer specifying the position at which the
   search should commence and the direction in which to search.

Details

The results of the NOTALPHA function depend directly on the TRANTAB
that is in effect, and indirectly on the ENCODING and LOCALE options.

The NOTALPHA function searches the string for the first occurrence of
any character that is not an upper or lower case letter. If any such
character is found, NOTALPHA returns the position in the string of that
character. If no such character is found, NOTALPHA returns a value of 0.

If only one argument is provided, NOTALPHA begins the search at
the left end of the string. If two arguments are provided, the
second argument, start, specifies the position at which to begin
the search and the direction in which to search:

 * For start > 0, the search begins at position start and proceeds
   to the right. If start is greater than the length of the string,
   zero is returned.

 * For start < 0, the search begins at position -start and proceeds
   to the left. If start is less than the negative of the length of
   the string, the search begins at the right end of the string.

 * For start = 0, zero is always returned.


Example

   data _null_;
      string = 'Next = _n_ + 12E3;';
      j = 0;
      do until(j = 0);
         j = notalpha(string,j+1);
         if j = 0 then put +3 "That's all";
         else do;
            c = substr(string,j,1);
            put +3 j= c=;
         end;
      end;
   run;

Output

   j=5 c=
   j=6 c==
   j=7 c=
   j=8 c=_
   j=10 c=_
   j=11 c=
   j=12 c=+
   j=13 c=
   j=14 c=1
   j=15 c=2
   j=17 c=3
   j=18 c=;
   That's all


See also:
   Functions:
      ANYALNUM
      ANYALPHA
      ANYCNTRL
      ANYDIGIT
      ANYFIRST
      ANYGRAPH
      ANYLOWER
      ANYNAME
      ANYPRINT
      ANYPUNCT
      ANYSPACE
      ANYUPPER
      ANYXDIGIT
      COUNTC
      FINDC
      INDEXC
      NOTALNUM
      NOTCNTRL
      NOTDIGIT
      NOTFIRST
      NOTGRAPH
      NOTLOWER
      NOTNAME
      NOTPRINT
      NOTPUNCT
      NOTSPACE
      NOTUPPER
      NOTXDIGIT
      VERIFY
%d bloggers like this: