How to use DSD and DLM in SAS

Demo Program 1:

Title “This is the DSD 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,English

102,Greg Carry,12,A,90,English

103,Marty     ,12,B,99,English

;

run;

proc print;

run;

 

Demo Program 2:

Title “Demo for DSD and DLM both in the same program”;

data demo;

infile cards dsd dlm=’&, ‘;

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 3:

Use of multiple infile options

data demo;

infile cards dsd missover dlm=’ ,&’;

input id age color$ race$;

cards;

100 23&white

101 63&white asian

102 78

103&23,black “african”

;

run;

proc print;

run;

Comments

comments

Sanaul

I am having more than 5+ years of experience in SAS Programming and Analysis. But I love to write that's why I am a freelancer writer. So that I can share my experience by working part time as a blogger. I used to travel and explore more and more. Please see my various articles about travel and tourism here

Leave a Reply

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

17 − ten =

Time limit is exhausted. Please reload CAPTCHA.