<?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: SAS DI in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571196#M17514</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's your DIS version?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 09:46:18 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-07-04T09:46:18Z</dc:date>
    <item>
      <title>SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570946#M17500</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;i need to take backup for SAS dataset in one SAS DI job&amp;nbsp; only on sunday's.i was trying below code but not working.please help or kindly suggest if you have any other best suggestions please.getting error as below.but the below code is not running by checking the condition,it is just running irrespective of condition.please help&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;21 %if %eval(&amp;amp;day = 01) %then %do;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: The %IF statement is not valid in open code.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;22 data work.&amp;amp;source_table._&amp;amp;date1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;23 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;24 set &amp;amp;_input1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;25 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;26 %end;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: The %END statement is not valid in open code.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _input1=sashelp.cars; 
%let source_table=cars;
%let date1 = %sysfunc(putn(%sysfunc(date()), yymmddn8.));
data _null_ ;
call symput('day', put(weekday(today()),z2.));
run;
%if %eval(&amp;amp;day = 01) %then %do; 
data  work.&amp;amp;source_table._&amp;amp;date1;

	set &amp;amp;_input1;
	

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570946#M17500</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-03T13:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570951#M17502</link>
      <description>&lt;P&gt;What version of SAS do you use?&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sasdummy/2018/07/05/if-then-else-sas-programs/" target="_self"&gt;Using %IF-%THEN-%ELSE in SAS programs&lt;/A&gt;&amp;nbsp;is valid from SAS 9.4M5&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570951#M17502</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-03T13:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570958#M17503</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some code along the line of below might do what you're after.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname bkup (work);
%let _input1=sashelp.cars; 

%macro backup(bkupLib=, bkupWeekDay=);
  %if %upcase(%sysfunc(today(), weekdate9.))=%upcase(&amp;amp;bkupWeekDay) %then
    %do;
      proc datasets lib=&amp;amp;bkupLib nolist nowarn;
        delete &amp;amp;source_table._%sysfunc(date(), yymmddn8.);
        run;
        append 
          base=&amp;amp;bkupLib..&amp;amp;source_table._%sysfunc(date(), yymmddn8.) 
          data=&amp;amp;_input1;
        run;
      quit;
    %end;
%mend;
%backup(bkupLib=bkup, bkupWeekDay=Wednesday)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with DIS if you implement via a custom transformation then code as below should be very close to what you need.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname bkup (work);

/* from source table connected to custom transformation */
%let _input0=sashelp.cars; 
/* from target table connected to custome transformation */
%let _output0=bkup.cars;

/* generated from prompt in custom transformation */
%let bkupWeekDay=Wednesday;

/* code in custom transformation */
%macro backup(bkupWeekDay);
  %local _target_lib _target_tbl;
  %let _target_lib=%scan(work.&amp;amp;_output0,-2,.);
  %let _target_tbl=%scan(&amp;amp;_output0,-1,.)_%sysfunc(date(), yymmddn8.);

  %if %upcase(%sysfunc(today(), weekdate9.))=%upcase(&amp;amp;bkupWeekDay) %then
    %do;
      proc datasets lib=&amp;amp;_target_lib nolist nowarn;
        delete &amp;amp;_target_tbl;
        run;
        append 
          base=&amp;amp;_target_lib..&amp;amp;_target_tbl 
          data=&amp;amp;_input0;
        run;
      quit;
    %end;
%mend;
%backup(&amp;amp;bkupWeekDay)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For the output table: Just create a placeholder metadata object which belongs to the backup library and with the root name of the backup table name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could alternatively also pass in the root name via a prompt but you still would need to ensure that the backup library gets assigned. That's something you get "for free" if using a placeholder metadata table object.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/570958#M17503</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-03T13:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571192#M17512</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30750i55810DB5F13BA31A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prompt.PNG" style="width: 593px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30751i4B9FA594A621E3D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="prompt.PNG" alt="prompt.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sourcecode.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30752iB535ABA1C639097D/image-size/large?v=v2&amp;amp;px=999" role="button" title="sourcecode.PNG" alt="sourcecode.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 09:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571192#M17512</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-04T09:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571196#M17514</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's your DIS version?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 09:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571196#M17514</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-04T09:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571198#M17515</link>
      <description>4.4 patrick,i was geting error when i try to open the custom output work table please</description>
      <pubDate>Thu, 04 Jul 2019 09:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571198#M17515</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-04T09:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571232#M17518</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;4.4 patrick,i was geting error when i try to open the custom output work table please&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm unfortunately on a more recent version so can't just share a .spk with you.&lt;/P&gt;
&lt;P&gt;You can't open the target table because the name of this table is not what the custom transform generates as output. It's always a bit difficult to define SAS metadata table objects if the name of this object is dynamic (the date part in the name).&lt;/P&gt;
&lt;P&gt;One way to get around this is to also always generate a view with the base name which then points to the most recent physical table with a name of &lt;EM&gt;basename_date&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;Below how you could do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Custom Transformation&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Source Code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro backup(bkupWeekDay);
  %local _target_lib;
  %let _target_lib=%scan(work.&amp;amp;_output0,-2,.);
  %let _target_tbl=%scan(&amp;amp;_output0,-1,.);
  %let _target_tbl=%sysfunc(substrn(&amp;amp;_target_tbl,1,23))_%sysfunc(date(), yymmddn8.);

  data _null_;
    if "%upcase(&amp;amp;_input0)"="%upcase(&amp;amp;_output0)" then
      do;
        put "Source and Target table may not be identical (same libref and table name)";
        put "aborting job... aborting job....";
        abort abend;
      end;
      stop;
  run;

  %if %eval(%sysfunc(today(), weekday.)=%unquote(&amp;amp;bkupWeekDay)) %then
    %do;
      /* backup source table into &amp;amp;_target_lib..&amp;amp;_target_tbl */
      proc datasets lib=&amp;amp;_target_lib nolist nowarn;
        delete &amp;amp;_target_tbl;
        run;
        append 
          base=&amp;amp;_target_lib..&amp;amp;_target_tbl 
          data=&amp;amp;_input0;
        run;
      quit;
      /* create view &amp;amp;_output0 over &amp;amp;target_lib..&amp;amp;target_tbl */
      proc sql;
        create view &amp;amp;_output0 as
          select *
          from &amp;amp;_target_lib..&amp;amp;_target_tbl
        ;
      quit;
    %end;
%mend;
%backup(&amp;amp;Weekday)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Prompt&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 521px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30757iDB03D28D3C22A844/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inputs/Outputs&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30758iDB2DD9E2A9437CEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DIS Job&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Define the target table as VIEW&lt;/P&gt;
&lt;P&gt;Give it a physical name not longer than 23 characters&lt;/P&gt;
&lt;P&gt;- The custom transformation will use the view name to construct the table name for the backup table as &amp;lt;view name&amp;gt;_&amp;lt;yymmdd&amp;gt;&lt;/P&gt;
&lt;P&gt;- The target table view will then point to the most recently created backup table.&lt;/P&gt;
&lt;P&gt;I would implement the target tables as permanent tables (=not as green but red/grey table objects)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also: Make sure you map source to target columns 1:1. This is functionally not necessary for the code to execute correctly but it will support metadata level column impact analysis.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571232#M17518</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-04T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571326#M17528</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for helping more on this,may i request to kindly help why we are defining all week day's in prompt please.&lt;/P&gt;&lt;P&gt;As i need just to take the backup only on sunday's please.&lt;/P&gt;&lt;P&gt;also kindly help on the use of below condition under data _null statement please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if "%upcase(&amp;amp;_input0)"="%upcase(&amp;amp;_output0)" then&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 07:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571326#M17528</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-05T07:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571347#M17529</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for helping more on this,may i request to kindly help why we are defining all week day's in prompt please.&lt;/P&gt;
&lt;P&gt;As i need just to take the backup only on sunday's please.&lt;/P&gt;
&lt;P&gt;also kindly help on the use of below condition under data _null statement please&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if "%upcase(&amp;amp;_input0)"="%upcase(&amp;amp;_output0)" then&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With a custom transformation potentially being a reusable asset why not define something that works for any day of the week. Doesn't take much extra work but might be useful. If Sunday is your preferred day then just define this day as the default.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The condition is just an extra step as a fail safe in case you give the target table the same name as the source table (under the same library).. You can drop this whole code bit if you want. I anyway realised that the custom transformation generated code (automatically generate delete code for outputs) would execute before this check so it's actually not useful. The most careful way would be: You keep the check, you don't tick check box "automatically generate delete code...", you add some code on your own after the check which deletes the output table (the view) if it exists. Some code as below should do:&lt;BR /&gt;proc datasets lib=%scan(work.&amp;amp;_output0,-2,.) nolist noward mt=(data view); delete %scan(&amp;amp;_output0,-1,.);run;quit&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 10:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571347#M17529</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-05T10:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571374#M17532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Iam getting error after running the custom tranformation,please find error screen shots and normal job properties screen shot please he&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cars_Job.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30770i77121AB26332E82D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cars_Job.PNG" alt="Cars_Job.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joberror.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30774i4A06965F57013FE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="joberror.PNG" alt="joberror.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="options_friday.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30771iBA9C8794921353F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="options_friday.PNG" alt="options_friday.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="properties of physical storage.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30772i5BC2A51B67208DA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="properties of physical storage.PNG" alt="properties of physical storage.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 13:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571374#M17532</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-05T13:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571448#M17535</link>
      <description>&lt;P&gt;It's a bit hard to debug a DIS job based on some screenshots. But looking at the Warning it appears that macro variable &amp;amp;weekday hasn't been defined.&lt;/P&gt;
&lt;P&gt;I've actually tested what I've posted and it works. I just can't share an .spk with you as I'm on DIS 4.903&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code I've posted &amp;amp;weekday is the parameter you pass into the macro call:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macroname"&gt;%backup&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Weekday&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;amp;Weekday is the name you must give the prompt for this to work. That's how this macro variable gets created and populated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also wrote "&lt;EM&gt;Give it a physical name not longer than &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;23&lt;/STRONG&gt;&lt;/FONT&gt; characters&lt;/EM&gt;" so a physical name for your output table of weekdaybackup_OUTPUT0 is not a suitable name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your source table is under a different libref than your target backup table then you can give your target table (view) the same name like the source table. So here just call it CARS.&lt;/P&gt;
&lt;P&gt;Assuming the "job default for temporary libraries" is WORK the SAS process will then create a view WORK.CARS and a physical SAS table WORK.CARS_&amp;lt;yyyymmdd&amp;gt; (like for today: WORK.CARS_20190706)&amp;nbsp; ....and that's why the view name may not be longer than 23 characters. It's used in the code to create the physical backup table with and underscore and date string added - so that's another 9 characters - and a SAS table name may not exceed 32 characters.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571448#M17535</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-05T16:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571674#M17548</link>
      <description>&lt;P&gt;Embracing the fact that we're using DI Studio, what not try a minimal code approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a job that backs up your dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then inside your main job, add a User Written Transform with the following code in it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &amp;amp;_output.;&lt;BR /&gt;&amp;nbsp; format Is_It_Sunday 8.;&lt;BR /&gt;&amp;nbsp; Is_It_Sunday = weekday(date());&lt;BR /&gt;&amp;nbsp; if Is_It_Sunday = 1 then output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and use the output of this node to feed a loop node with the "backup job" attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bingo, the back up "sub job" only runs on Sundays. Easily permutated into running all sorts of days of the week.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, consider if this isn't a question of scheduling/orchestration, and use LSF and timed triggering of a dedicated backup flow once a week. Is it really the responsibility of a data processing job to do backups?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2019 22:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571674#M17548</guid>
      <dc:creator>AngusLooney</dc:creator>
      <dc:date>2019-07-07T22:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571706#M17550</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153471"&gt;@AngusLooney&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I normally consider a custom transformation as a reusable artefact and as such one should put a bit of effort into it to make it robust and performing.&lt;/P&gt;
&lt;P&gt;What you propose here is a process which every single time needs to read the whole source data set whether it's a "backup day" or not.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 07:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571706#M17550</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-08T07:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571710#M17551</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Actually i have SAS4.9 DI also installed .but the logic i need to impmenet this under 4.4.would it be possible to provide .spk file please just to compare and debug the code&amp;nbsp; please.so that i can compare what is wrong iam doing under 4.4 please&lt;/P&gt;&lt;P&gt;Actually i have created prompt correctly only please.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 08:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571710#M17551</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-08T08:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571722#M17552</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Actually i have SAS4.9 DI also installed .but the logic i need to impmenet this under 4.4.would it be possible to provide .spk file please just to compare and debug the code&amp;nbsp; please.so that i can compare what is wrong iam doing under 4.4 please&lt;/P&gt;
&lt;P&gt;Actually i have created prompt correctly only please.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here you go.&lt;/P&gt;
&lt;P&gt;The attached .spk contains two objects.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 149px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30816i240ECC24B0DABAC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a self contained fully executable DIS job which you can import using DIS4.9 into a folder of your choosing. All data created is in WORK.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 380px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30815iEA6F33733B8592CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've created the package under DIS4.903 and tested that the import with this DIS version works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for debugging stuff:&lt;/P&gt;
&lt;P&gt;I often copy/paste the DIS generated code to EG for such debugging work, figure out what's not working and where I need to change and then apply the successful changes to DIS.&lt;/P&gt;
&lt;P&gt;If things are still not working in DIS then I normally copy the most recent DIS generated code again into EG and reiterate the process.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 09:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571722#M17552</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-08T09:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571728#M17553</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;,I tried in 4.4 version itself,successfully imported and ran the job with out any errors.&lt;/P&gt;&lt;P&gt;Thanks for kind response ,even though i asked silly &amp;amp; simple things please.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 10:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI/m-p/571728#M17553</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-07-08T10:40:08Z</dc:date>
    </item>
  </channel>
</rss>

