<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help trouble shooting program to produce multiple folders with a macro. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216434#M39894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really much in the way of a macro here, b&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ut perhaps you mean you are attempting to create macro VARIABLES ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Your code at the top is way too complicated and you are creating macro variables with plus signs in them.&amp;nbsp; Don't you want the macro variables to just have 2 or 4 digit year values?&amp;nbsp; Then you can use them much more easily in the rest of the program without all of those %EVAL() calls.&amp;nbsp; Since it looks like we are just talking about integer math here you can do that very easily in %LET statements.&amp;nbsp; Note that you might have issues with leading zeros on the 2 digit years if this program is still running in another 80 years.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; PE_TERM=20143;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;PE_YR - 4 digit year that evaluation is conducte&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;ST_YR - 2 digit start year for the grads&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;JK&amp;nbsp;&amp;nbsp;&amp;nbsp; - 2 digit year to use in libref&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pe_yr=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;pe_term,1,4)+3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; st_yr=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;pe_term,3,2)+1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; jk=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;st_yr+2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; PE_TERM=20143 PE_YR=2017 ST_YR=15 JK=17&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Not sure what the rest of the program is trying to do. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Looks like you want to create some directories and at least one of them you want point a libref to.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;What do you want to do with the others?&amp;nbsp; Are you going to point filerefs to them?&amp;nbsp; Or other librefs?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Do you also need the paths to be stored in macro variables or are the LIBREF/FILEREF definitions enough?&amp;nbsp; How is the down stream program going to reference the environment?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;So here is macro that will take as input the 4 digit year.&amp;nbsp; It then use that four digit year to make two macro variables and four directories.&amp;nbsp; Plus it will make a LIBREF using the last two digits of the year.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; make_dirs(yr);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%global&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; PXDIR FPATH;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pxdir=C:\PROG EVAL &amp;amp;yr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; fpath=C:\CPSASLIB\PROGEVAL&amp;amp;yr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir\DATA"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir\GFU"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;yr"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; libname PE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;yr,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;fpath"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; make_dirs ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;make_dirs&lt;/EM&gt;&lt;/STRONG&gt;(&amp;amp;pe_yr);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2015 04:02:31 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-05-19T04:02:31Z</dc:date>
    <item>
      <title>Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216430#M39890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My goal is to create A program that will create all the macros and File folders that are required for a given project, with minimal upfront coding. I have multiple annual projects that I will be doing this for and most of these projects use the same data sources and formats each year; so my ultimate goal is to use one macro to create all the variables and report names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current issue ( I am sure I will have more before I am through) is that I do have enough knowledge of macros to identify why my program is not producing the correct file folders.&amp;nbsp; The SASA program and log are below (. .&amp;nbsp; Before I ran this program. I checked that any folders that I was trying to created DID NOT exist; this included deleting the files the program was creating in the wrong directory; exited SAS; and started it new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The log indicates hat &lt;SPAN style="background: yellow; line-height: 107%; font-family: 'SAS Monospace'; font-size: 8pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'SAS Monospace'; mso-highlight: yellow;"&gt;The directory "C:\PROG EVAL 2017" exists&lt;/SPAN&gt;&amp;nbsp; (But it did not and does not); and that &lt;SPAN style="background: yellow; line-height: 107%; font-family: 'SAS Monospace'; font-size: 8pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'SAS Monospace'; mso-highlight: yellow;"&gt;C:\PROG EVAL 2017\Data and &lt;SPAN style="background: yellow; line-height: 107%; font-family: 'SAS Monospace'; font-size: 8pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'SAS Monospace'; mso-highlight: yellow;"&gt;C:\PROG EVAL 2017\Data\GFU&lt;/SPAN&gt;&lt;/SPAN&gt;. were created BUT they were not.&amp;nbsp; The&amp;nbsp; &lt;SPAN style="background: yellow; line-height: 107%; font-family: 'SAS Monospace'; font-size: 8pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-font-family: 'SAS Monospace'; mso-highlight: yellow;"&gt;C:\CPSASLIB\PROGEVAL2017&lt;/SPAN&gt;&amp;nbsp; folder was created and the LIBREF was assigned correctly.&amp;nbsp; What the program did do is&amp;nbsp; create the following folders C:\PROG EVAL 2015\PE HEAD\2017;&amp;nbsp; C:\PROG EVAL 2015\PE HEAD\2017\DATA;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\PROG EVAL 2015\PE HEAD\2017\DATA\GFU and&amp;nbsp; C:\PROG EVAL 2015\PE HEAD\EVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOG&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: SAS (r) Proprietary Software 9.3 (TS1M2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Licensed to STATE BOARD FOR TECH &amp;amp; COMP EDU - ADMIN, Site 70049135.&lt;/P&gt;&lt;P&gt;NOTE: This session is executing on the W32_7PRO&amp;nbsp; platform.&lt;/P&gt;&lt;P&gt;NOTE: Enhanced analytical products:&lt;/P&gt;&lt;P&gt;SAS/STAT 12.1, SAS/ETS 12.1, SAS/OR 12.2, SAS/IML 12.1, SAS/QC 12.1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;NOTE: SAS initialization used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.07 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.59 seconds&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*THIS IS A PROGRAM THAT ESTABLISHES THE MACROS THAT WILL BE USED FOR THE PROGRAM&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; EVALUATION SAS PROGRAMS*/&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Change The PE_TERM Value To The Starting Summer Term*/&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; %let PE_TERM=20143;&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp; /*****************************************************/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp; /***************FIXED MACROS DO NOT CHANGE*******************/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp; %LET PE_YR=%SYSFUNC(INT(%EVAL(&amp;amp;PE_TERM/10)))+3;/*Resolves to the year the eval is conducted&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;10 ! 2015*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;11 %LET ST_YR=%sysfunc(MOD(%sysfunc(INT(%EVAL(&amp;amp;&amp;amp;PE_TERM/10))),100))+1;/*resolves to the 2-Digit&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;11 ! start yrr for the grads*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp; %LET JK=%eval(&amp;amp;st_yr)+2;&amp;nbsp; /*resolves to the correct YR for the libname*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;13&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;14&amp;nbsp;&amp;nbsp; /*****************************************************/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp; OPTIONS NONUMBER NODATE NOBYLINE mprint mlogic SYMBOLGEN;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp; TITLE;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;18&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp; /*CREATES the MACRO FOR MAIN FOLDER*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp; %Let PXDIR=C:\PROG EVAL %EVAL(&amp;amp;PE_YR);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PE_YR resolves to 2014+3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;21&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp; /*CREATES MACRO FOR SAS LIBRARY FOLDER PATH. */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;23&amp;nbsp;&amp;nbsp; %Let fpath=C:\CPSASLIB\PROGEVAL%EVAL(&amp;amp;PE_YR);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PE_YR resolves to 2014+3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp; /*****************************************************/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp; /*CREATES THE NEW PE FOLDER AND SUBFOLDERS*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;26&amp;nbsp;&amp;nbsp; %macro chk_dir(dir=) ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options noxwait;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %local rc fileref ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let rc = %sysfunc(filename(fileref,&amp;amp;dir)) ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %sysfunc(fexist(&amp;amp;fileref))&amp;nbsp; %then&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put NOTE: The directory "&amp;amp;dir" exists ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %sysexec md&amp;nbsp;&amp;nbsp; &amp;amp;dir ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;35&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %sysfunc(sysmsg()) The directory has been created. ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;36&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;37&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let rc=%sysfunc(filename(fileref)) ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;38&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;39&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend chk_dir ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;41&amp;nbsp;&amp;nbsp;&amp;nbsp; %chk_dir(DIR=&amp;amp;PXDIR) ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PXDIR resolves to C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Parameter DIR has value C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHK_DIR):&amp;nbsp;&amp;nbsp; options noxwait;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LOCAL&amp;nbsp; RC FILEREF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FILEREF resolves to #LN00012&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %IF condition %sysfunc(fexist(&amp;amp;fileref)) is TRUE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %PUT NOTE: The directory "&amp;amp;dir" exists&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: The directory "C:\PROG EVAL 2017" exists&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;42&amp;nbsp;&amp;nbsp; %chk_dir(DIR=&amp;amp;PXDIR\DATA);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PXDIR resolves to C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Parameter DIR has value C:\PROG EVAL 2017\DATA&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHK_DIR):&amp;nbsp;&amp;nbsp; options noxwait;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LOCAL&amp;nbsp; RC FILEREF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017\DATA&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FILEREF resolves to #LN00013&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %IF condition %sysfunc(fexist(&amp;amp;fileref)) is FALSE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %SYSEXEC&amp;nbsp; md&amp;nbsp;&amp;nbsp; &amp;amp;dir&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017\DATA&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %PUT %sysfunc(sysmsg()) The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Physical file does not exist, C:\PROG EVAL 2017\DATA. The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;43&amp;nbsp;&amp;nbsp;&amp;nbsp; %chk_dir(DIR=&amp;amp;PXDIR\GFU);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PXDIR resolves to C:\PROG EVAL 2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Parameter DIR has value C:\PROG EVAL 2017\GFU&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHK_DIR):&amp;nbsp;&amp;nbsp; options noxwait;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LOCAL&amp;nbsp; RC FILEREF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017\GFU&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FILEREF resolves to #LN00014&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %IF condition %sysfunc(fexist(&amp;amp;fileref)) is FALSE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %SYSEXEC&amp;nbsp; md&amp;nbsp;&amp;nbsp; &amp;amp;dir&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017\GFU&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %PUT %sysfunc(sysmsg()) The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Physical file does not exist, C:\PROG EVAL 2017\GFU. The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;44&amp;nbsp;&amp;nbsp;&amp;nbsp; %CHK_DIR(DIR=C:\CPSASLIB\PROGEVAL%EVAL(&amp;amp;PE_YR));&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable PE_YR resolves to 2014+3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Parameter DIR has value C:\CPSASLIB\PROGEVAL2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHK_DIR):&amp;nbsp;&amp;nbsp; options noxwait;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LOCAL&amp;nbsp; RC FILEREF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\CPSASLIB\PROGEVAL2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FILEREF resolves to #LN00015&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %IF condition %sysfunc(fexist(&amp;amp;fileref)) is FALSE&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %SYSEXEC&amp;nbsp; md&amp;nbsp;&amp;nbsp; &amp;amp;dir&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\CPSASLIB\PROGEVAL2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %PUT %sysfunc(sysmsg()) The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Physical file does not exist, C:\CPSASLIB\PROGEVAL2017. The directory has been created.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; %LET (variable name is RC)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(CHK_DIR):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable JK resolves to 15+2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;45&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;46&amp;nbsp;&amp;nbsp; /*CREATE THE NEW&amp;nbsp; THE LIB REF*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;47&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;48&amp;nbsp;&amp;nbsp; LIBNAME PE%EVAL(&amp;amp;JK) "&amp;amp;fpath";&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FPATH resolves to C:\CPSASLIB\PROGEVAL2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: Libref PE17 was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V9&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical Name: C:\CPSASLIB\PROGEVAL2017&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;49&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;50&amp;nbsp;&amp;nbsp; proc format;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;50 !&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value BGRAD&amp;nbsp;&amp;nbsp;&amp;nbsp; 0-5= '#e13300'&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;51&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6-1000= 'BLACK';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: Format BGRAD has been output.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;52&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06 seconds&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 10:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216430#M39890</guid>
      <dc:creator>madhatter</dc:creator>
      <dc:date>2015-05-18T10:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216431#M39891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Couple of things from my side:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; If this is setting up a directory structure and file, my recommendation would be that you have IT do this.&amp;nbsp; They would copy the necessary information across, and assign access rights per the study.&amp;nbsp; This would be the ideal process, and would always be my preferred approach.&amp;nbsp; Systems setup should be done and controlled by those best in the know.&amp;nbsp; Also, there should be version control setup there etc. so not just a matter of dirs and files.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; If the above is not possible, then you will have to take on the role of administrator yourself.&amp;nbsp; Some extra work.&amp;nbsp; Create a folder structure, add in the files.&amp;nbsp; Then when a new project comes in, copy that template across.&amp;nbsp; Of course you would need to setup version control etc. assign access rights and such like yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These would be the better, and worse case scenarios.&amp;nbsp; I wouldn't in any way do this through SAS, especially with your quote "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; I do have enough knowledge of macros to".&amp;nbsp; Your IT guys should be able to do this pretty easily as they will have the tools, for instance 6 months down the line if you want to move folders, add new ones, allow other access to certain folders etc. then your back to stage one.&amp;nbsp; They have the tools to make changes and cascade down across a fixed structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some other things to remember, where is your SAS installed?&amp;nbsp; If its on a server then the C: drive will not be your local C: drive.&amp;nbsp; I would also avoid spaces and special characters in your path setup.&amp;nbsp; As for your macro, if you want to debug it then write the program do it it once.&amp;nbsp; Work on small parts of it, see what is happening, use options symblogen, mprint, mlogic. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 10:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216431#M39891</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-18T10:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216432#M39892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, this is setting up directories and files , SAS 9.3. on a PC, so IT is not going to do it. And copying and renaming folders and files is so lame. I am setting up my major recurring Semester Based studies to run with ONE or TWO macros that set the parameters for the data acquisition from the various sources; the parameters and variables names for the analysis; the titles, column headers, etc. for the reports; and the output file name for the reports. I have been fairly successful with that and getting better.&amp;nbsp; My problem with the macros in my example program for creating the actual folders and subfolders I need is that I do not understand why my SAS LOG log states "&lt;STRONG&gt;SYMBOLGEN:&amp;nbsp; Macro variable DIR resolves to C:\PROG EVAL 2017\GFU/MLOGIC(CHK_DIR):&amp;nbsp; %PUT %sysfunc(sysmsg()) The directory has been created.WARNING: Physical file does not exist, C:\PROG EVAL 2017\GFU. The directory has been created&lt;/STRONG&gt;."&amp;nbsp; But the directory is not created; at least where it is suppose to be created. What was created were folders named:&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;EVAL&lt;/STRONG&gt;, &lt;STRONG&gt;2017\GFU&lt;/STRONG&gt;, and&amp;nbsp; &lt;STRONG&gt;2017\DATA&lt;/STRONG&gt; in the &lt;STRONG&gt;C:\PROG EVAL 2015\PE HEAD&lt;/STRONG&gt; folder, which is the folder where this SAS program resides.&amp;nbsp; I guess that I can take the cheap way and create SAS ref&amp;nbsp; lib folders and then clear the ref lib name; but was hoping would be able to see the error(s) with my macros.&lt;/P&gt;&lt;P&gt;rlWy successful with that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 22:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216432#M39892</guid>
      <dc:creator>madhatter</dc:creator>
      <dc:date>2015-05-18T22:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216433#M39893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Around Line 23 - is this what you were expecting?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable PE_YR resolves to 2014+3&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Also, I think there's a simpler way with option dlcreatedir &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A class="active_link" href="http://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/" title="http://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/"&gt;http://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;And/Or using DCREATE function rather than system commands. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 02:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216433#M39893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-05-19T02:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216434#M39894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really much in the way of a macro here, b&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ut perhaps you mean you are attempting to create macro VARIABLES ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Your code at the top is way too complicated and you are creating macro variables with plus signs in them.&amp;nbsp; Don't you want the macro variables to just have 2 or 4 digit year values?&amp;nbsp; Then you can use them much more easily in the rest of the program without all of those %EVAL() calls.&amp;nbsp; Since it looks like we are just talking about integer math here you can do that very easily in %LET statements.&amp;nbsp; Note that you might have issues with leading zeros on the 2 digit years if this program is still running in another 80 years.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; PE_TERM=20143;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;PE_YR - 4 digit year that evaluation is conducte&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;ST_YR - 2 digit start year for the grads&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;JK&amp;nbsp;&amp;nbsp;&amp;nbsp; - 2 digit year to use in libref&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pe_yr=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;pe_term,1,4)+3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; st_yr=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;pe_term,3,2)+1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; jk=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;st_yr+2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; PE_TERM=20143 PE_YR=2017 ST_YR=15 JK=17&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Not sure what the rest of the program is trying to do. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Looks like you want to create some directories and at least one of them you want point a libref to.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;What do you want to do with the others?&amp;nbsp; Are you going to point filerefs to them?&amp;nbsp; Or other librefs?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Do you also need the paths to be stored in macro variables or are the LIBREF/FILEREF definitions enough?&amp;nbsp; How is the down stream program going to reference the environment?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;So here is macro that will take as input the 4 digit year.&amp;nbsp; It then use that four digit year to make two macro variables and four directories.&amp;nbsp; Plus it will make a LIBREF using the last two digits of the year.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; make_dirs(yr);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%global&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; PXDIR FPATH;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pxdir=C:\PROG EVAL &amp;amp;yr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; fpath=C:\CPSASLIB\PROGEVAL&amp;amp;yr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir\DATA"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;pxdir\GFU"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=system(catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'md'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;yr"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; libname PE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;yr,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;fpath"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; make_dirs ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;make_dirs&lt;/EM&gt;&lt;/STRONG&gt;(&amp;amp;pe_yr);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 04:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216434#M39894</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-19T04:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216435#M39895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me the simplest solution will be this:&lt;/P&gt;&lt;P&gt;Do_not_use_blanks_in_file_or_directory_names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 06:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216435#M39895</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-19T06:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216436#M39896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, so this isn't a commercial thing, just something for yourself.&amp;nbsp; Then that is different.&amp;nbsp; I would still recommend creating a template and then copy/pasting it - even if its just you (think how much time you have taken to create the macro), setup a version control system - TortoiseSVN if your on windows is easy, then you can copy through that.&amp;nbsp; Otherwise you will lose something eventually.&amp;nbsp; Also, all my other points excluding IT are still valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+1 to KurtBremser.&amp;nbsp; Its never recommended to have spaces (or specials) in filename/paths at any time.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 07:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216436#M39896</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-19T07:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help trouble shooting program to produce multiple folders with a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216437#M39897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom. What you provided was most helpful.&amp;nbsp; I am applying this to another current annual projects, ; One tracks 6 student cohorts (Fall 2008...Fall 2013) thru the 2014 fall term, reporting how many were retained/transferred/graduated in each intervening term; next year the 2014 cohort will be added; then 2015,&amp;nbsp; ad infinitum. This project's directory structure is: a main folder (year); subfolders for each cohort; and six sub-folders for each cohort. Office policy dictates all project data/programs be maintained in a project folder on the server. Copying and editing last years 30&amp;nbsp; folders, files &amp;amp; program names and then editing the program fileref names appropriately, as was previously done, would been quicker than developing this process using macros....this year. But extrapolating the copy &amp;amp; edit time for future years &amp;amp; the increasing number of cohorts, no way.&amp;nbsp; And I have learned a lot. After I finish this year's reports, I'm going to do a program to create the folders for the new year and copy the requisite SAS program files from the past year, all correctly named; and do it with an array, Do Loop, and macros;&amp;nbsp; I'm sure you'll see other questions from me here in the future as I stumble along.&amp;nbsp; Again, thanks for taking the time to offer some very useful information/guidance rather than pontificate;, it is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 23:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-trouble-shooting-program-to-produce-multiple-folders/m-p/216437#M39897</guid>
      <dc:creator>madhatter</dc:creator>
      <dc:date>2015-05-20T23:24:59Z</dc:date>
    </item>
  </channel>
</rss>

