<?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: How to create a macro variable for use in multiple DI Studio jobs in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217147#M5301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want these always, call from autoexec_usermods.&lt;/P&gt;&lt;P&gt;Else, call from the pre-step of each job where the resulting macro variables should be used.&lt;/P&gt;&lt;P&gt;Then, just use the macro variables in your (mainly, hopefully) standard Di transformations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 15:30:20 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2015-07-01T15:30:20Z</dc:date>
    <item>
      <title>How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217142#M5296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not certain this the best place for me to ask this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our office is just starting with DI Studio 4.9, and I am the only one using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our system deals with university students.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write a job that gets NEW students - only students enrolled in the current / target term.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that I used when using Base SAS to accomplish a similar goal. It looked at the current day, compared that to our Terms table and looked for a Term that had a start_date &amp;lt;= current date &amp;lt;= end_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This macro returns the Term as well as the Day of the Term - start_date = current_date then Day of Term = 1, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to incorporate this, or something similar into my DI Studio job so that I can use these variables in my DI Studio jobs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please point me to the best resource for learning more about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 16:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217142#M5296</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-06-30T16:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217143#M5297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still remember my first encounter with DI Studio after many years of SAS coding - and it was first quite challenging and - to be honest - annoying. Make sure you get the necessary training (like: DI Studio Fast Track) before using this tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for your question: You can create a custom transformation and have your macro call in there (an the actual macro either within the transformation or outside in an autocall folder).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 07:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217143#M5297</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-01T07:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217144#M5298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For filtering, use the Extract transform. You enter you filter i the Where tab.&lt;/P&gt;&lt;P&gt;You could use &amp;amp;Sydate, or any other macro variable (that you need to set outside the transformation - where depends on your overall setup).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 10:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217144#M5298</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-01T10:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217145#M5299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I try to answer your question more directly: how do you wish to set the value of your "current_day" macro variable?&lt;/P&gt;&lt;P&gt;Macro variables can be set/defined in multiple of ways, most of them are not DI Studio specific (-sysparm, sysget(), value from look-up table, macro logic called from autoexec/job pre-code, parameter to the job) and perhaps a few more....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 10:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217145#M5299</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-01T10:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217146#M5300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a sloppy macro variable that does the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Retrieves from the Terms table in our database and retrieves the current semester's value (15/FA, for instance), start_date, and end_date.&lt;/LI&gt;&lt;LI&gt;Counts the "raw" number of days between these two (raw because it counts at this point weekends and holidays).&lt;/LI&gt;&lt;LI&gt;Retrieves holidays from the Holidays table, which is joined back in with the local semesters table, and at this point, both holidays and weekends are removed.&lt;/LI&gt;&lt;LI&gt;Days in the semester are recounted.&lt;/LI&gt;&lt;LI&gt;At the end of the macro, the following variables are produced - all of these are used in other programs:&lt;UL&gt;&lt;LI&gt;SEM /*FA for Fall, SP for Spring, etc*/&lt;/LI&gt;&lt;LI&gt;SemDay /*1 for start_date, etc*/&lt;/LI&gt;&lt;LI&gt;TDY /*Two Digit Year, 15 for 2015*/&lt;/LI&gt;&lt;LI&gt;RTERM /*Reporting Term - for use in outputting a file*/&lt;/LI&gt;&lt;LI&gt;STERM /*Subsetting Term - for use in another program*/&lt;/LI&gt;&lt;LI&gt;QTERM /*Querying Term*/&lt;/LI&gt;&lt;LI&gt;STC_QTERM /*When querying the STC table*/&lt;/LI&gt;&lt;LI&gt;STTR_QTERM /*When querying the STTR table*/&lt;/LI&gt;&lt;LI&gt;UFTPT /*The threshold for determining if an undergraduate is full time or part time, which depends on which semester they are in (Summer is different from Fall/Spring)*/&lt;/LI&gt;&lt;LI&gt;GFTPT/*Same as above, except for graduate students*/&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can copy and paste the macro if that helps - or attach it as a file (it is around 190 lines).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, I would have these for use throughout multiple jobs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all again for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 14:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217146#M5300</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-07-01T14:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217147#M5301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want these always, call from autoexec_usermods.&lt;/P&gt;&lt;P&gt;Else, call from the pre-step of each job where the resulting macro variables should be used.&lt;/P&gt;&lt;P&gt;Then, just use the macro variables in your (mainly, hopefully) standard Di transformations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217147#M5301</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-01T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217148#M5302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to call them, always, for a set of jobs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have my flow / folder structure broken up into Extract (Jobs and the Tables they produce), Transform (Jobs &amp;amp; Tables), Warehouse_Load (Jobs &amp;amp; Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are currently 8 jobs in the Extract folder, and at this point - these are the only jobs I see needing access to the created macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have never heard of the autoexec_usermods. I have seen the precode / postcode tab of the job properties, but have never used it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since these macro variables will span jobs, it seems like a better option to just assume I want them always.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217148#M5302</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-07-01T15:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217149#M5303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A year ago, when we first purchased the software, I went to the first training (SAS DI Studio 1: Essentials - not the Fast Track). However, it took a year to get the hardware and get everything installed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could definitely use a refresher, but it will have to wait until September of this year, probably.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping to get started on some of the basics before then. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217149#M5303</guid>
      <dc:creator>GregG</dc:creator>
      <dc:date>2015-07-01T15:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217150#M5304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's may be personal style but I don't like pre- and post-code in DI jobs as they are so hidden. If you want to have a re-usable macro call then I would still go for a custom transformation. You store the macro itself in a SAS Autocall library, you have the macro call in the custom transformation, and if the macro has parameters then you define these parameters as prompts in the custom transformation.&lt;/P&gt;&lt;P&gt;You then simply drag this custom transformation into any job where you need it executed. This way it's easy to use but also clearly visible in the job flow.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Looking at what you describe your macro is doing: Have you considered using a custom interval instead of doing these joins every single time? &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 22:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217150#M5304</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-01T22:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217151#M5305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;appserver_autoexec_usermods are located in the SAS configuration directory, usually in the path (OS, not SAS metadata folders)&lt;/P&gt;&lt;P&gt;..Lev&lt;EM&gt;N&lt;/EM&gt;\SASApp\appserver_autoexec_usermods.sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 11:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217151#M5305</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-07-02T11:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217152#M5306</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; font-size: 13px; background-color: #ffffff;"&gt;There are currently 8 jobs in the Extract folder, and at this point - these are the only jobs I see needing access to the created macro variables.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that only a sub-set of jobs needs these macro variables defined AND that it requires "expensive" joining of data I would consider the autoexec the wrong place to execute this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 20:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217152#M5306</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-02T20:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable for use in multiple DI Studio jobs</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217153#M5307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@GregG&lt;/P&gt;&lt;P&gt;The autoexec is used to "set-up" your environment. It is executed whenever you start a new session or batch-job. You should only place stuff into the autoexec which is required to set-up an environment. If you have a syntax error in the autoexec then SAS won't start up and you can bring down the whole "system".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 20:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-macro-variable-for-use-in-multiple-DI-Studio/m-p/217153#M5307</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-07-02T20:46:11Z</dc:date>
    </item>
  </channel>
</rss>

