How to use PDV in SAS

Here you will find out the best tutorials for Program Data Vector (PDV). How to use PDV in SAS and how to use PDV in different programs. I tried to put PDV in different types of SAS programs so just go through these. I will update this post weekly and add different new programs so that you can get the best.

Demo Program 1

DATA PDV_DEMO;
infile cards;
input id faminc1-faminc12;
put "This is to use PDV and check the execution in the Log Window:"_all_;
cards;
1 1 2 3 4 5 6 7 8 9 10 11 12
2 2 3 4 5 6 7 8 9 8 7 6 5
;
RUN;
PROC PRINT DATA=PDV_DEMO;
RUN;

Demo Program 2

Title "This is the PDV Demo";
Footnote "Program Ends here";
data demo;
infile cards dsd;
put "This is to see the execution in the log window:"_all_;
input +0 roll_number 3. +1 name $ 10. +1 class 2. +1 section $ 1. +1 marks 2. +1 Subject $ 7.;
cards;
101,John Smith,12,A,85,Maths
102,Greg Carry,12,A,90,Maths
103,Marty     ,12,B,99,Maths
;
run;
proc print;
run;

Demo Program 3

Tittle "PDV Demo 2";
data demo;
infile cards dsd dlm='&, ';
put "This is to see the execution in the log window:"_all_;
input id name $ age color $;
cards;
100&kumarrao&78,white
101 kiran,89,"black"
102&lava,78,white
102,kumar,67,"brown"
;
run;
proc print;
run;

 

Demo Program 4

data demoforPDV;
infile cards dsd missover dlm=' ,&';
put "This is to see the execution in the log window:"_all_;
input id age color$ race$;
cards;
100 23&white
101 63&white asian
102 78
103&23,black "african"
;
run;
proc print;
run;

Demo Program 5

data new;
input id value1-value12;
put "This is to use PDV and check the execution in the Log Window:"_all_;
cards;
1 1 2 3 4 5 6 7 8 9 10 11 12
2 21 22 23 24 25 26 27 28 29 30 31 32
;
run;
proc print data=new;
run;
data new1;
set new;
      new_value1=value1 * .01;
      new_value2=value2 * .01;
      new_value3=value3 * .01;
      new_value4=value4 * .01;
      new_value5=value5 * .01;
      new_value6=value6 * .01;
      new_value7=value7 * .01;
      new_value8=value8 * .01;
      new_value9=value9 * .01;
      new_value10=value10 * .01;
      new_value11=value11 * .01;
      new_value12=value12 * .01;
put "This is to use PDV and check the execution in the Log Window:"_all_;
run;
proc print data=new1;
run;

Comments

comments

InRaMS

InRaMS technologies is a web based company here we have Digital marketing, web development. In digital marketing we have Small SEO tools and also Try this Website SEO Audit Tool

Leave a Reply

Your email address will not be published. Required fields are marked *

10 + 9 =

Time limit is exhausted. Please reload CAPTCHA.