Help using Base SAS procedures

Help on folder creation modification

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 117
Accepted Solution

Help on folder creation modification

Hi There,

I have the following code :

data _null_;

  rootdir='C:\temp\';

  today=today();

  lastmonth=intnx('month',today,-1);

  dir1=catx(' ','DE',year(lastmonth),put(month(lastmonth),z2.)); /*Previous Month*/

  newdir1=dcreate(dir1,rootdir);

  put (rootdir dir1 newdir1) (=/);

run;

this generates a directory which is named : DE 2012 01

I would like this to appear as : DE 201201 (notice no gap after year)

How would I modify the query to achieve this?

Thanks!


Accepted Solutions
Solution
‎02-16-2012 12:56 PM
Respected Advisor
Posts: 3,141

Help on folder creation modification

dir1=cat('DE ',year(lastmonth),put(month(lastmonth),z2.));

Haikuo

View solution in original post


All Replies
Solution
‎02-16-2012 12:56 PM
Respected Advisor
Posts: 3,141

Help on folder creation modification

dir1=cat('DE ',year(lastmonth),put(month(lastmonth),z2.));

Haikuo

Frequent Contributor
Posts: 117

Help on folder creation modification

Worked! Thanks Smiley Happy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 158 views
  • 0 likes
  • 2 in conversation