Vous êtes sur la page 1sur 2

* Lenght/lengthn/lengthc:

data lambae;
x="Ashutosh Singh Sera
y=lengthc(x);
z=lengthn(x);
A=length(x);
B=length(" As hu ");
C=lengthn("
As hu
run;

";

");

*Low up and prop case


data casesofcharacter;
x="ASHUtosh";
y="Nishu SINGH 007";
A=upcase(x);
B=lowcase(x);
C=upcase(y);
D=lowcase(y);
*E=propcase(x);
*F=propcase(y);
run;
*3 compress blank and spaces
Data compression;
X=" Ashutosh
Mahendra pratap
A="As 007 hu 23 02 1983 ";
y=compbl(x);
Z=compress(x);
C=compbl(A);
D=compress(A);
run;

* Cocatenation
data concatenation;
A=" Ashutosh Singh
B=" Mahendra ";
C=A || B;
D=Cat(A,B);
E=Cats(A,B);
F=Catx("@ ",A,B);
file print ;
put C=/
D=/
E=/
F=/
;
run;

";

*left trim strip


data triming;
A="
^ Ashutosh

Singh @ ";

Singh

";

B=" Mahendra ";


C="&" ||trim(A) || "?";
D= "&" ||left(B) || "?";
E= "&" || strip(A) || "?";
F= "&" || strip(B) || "?";
run;

*Compress variation

*find and find C

data Cmpressvariation;
String = "X1y2Z3";
Y=find(String,'23');
a=findc(String,'2','3');
b=findc(String,'3');
C=find(String,'Z3');
run;

find substring
data Cmpressvariation;
String = "Ashutosh Singh mahendra pratap";
Y=substr(String,2,7);
Z=find(String,"tosh");
father=scan(string,3);
beta=scan(string,1);
surbane=scan(string,2);
run;

Vous aimerez peut-être aussi