sas - Adding a value to the column while importing a CSV file in CSV -


right i'm importing csv file using below code...and updating column(date) macro variable(rundate).

%let rundate = 25jan2015; data import (keep = date id); infile "&infl." delimiter = ',' missover dsd lrecl=32767 firstobs=2;     informat id $22. ;     informat date $1. ;         format id $22. ;         format date $1. ;         input id $ date $; run;  data import ; set import(drop=date);      date="&rundate"d; format date date9.; run;  

is possible achieve in 1 step updating column(date) macro variable while importing csv file?

of course, long you're using data step read in file (as are). you're welcome normal data step code in step inputting file.

%let rundate = 25jan2015; data import (keep = date id); infile "&infl." delimiter = ',' missover dsd lrecl=32767 firstobs=2;     informat id $22. ;     informat __dropme $1. ;         format id $22. ;         format __dropme $1. ;         input id $ __dropme $;     date="&rundate"d; format date date9.;     drop __dropme; run;  

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -