Date: Mon, 25 May 2009 12:47:03 -0400
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: Data Step+ Proc SQL
yes, a bit confusing for me. If I understand that right, the first
(initial) run is the 25May2005's run.
All others seem to add a record at the end, where the coderun comes from
datetime() and the lastrun should be the previous coderun (for second run,
the 25May2005). If that is the case, where is the first record? That with
both 25May2005? Or does the second run replace the first record? And the
third run? It doesn't replace it, but adds one?
Gerhard
On Mon, 25 May 2009 11:38:23 -0400, SUBSCRIBE SAS-L Joe H. Smith
<peesari.mahesh@GMAIL.COM> wrote:
>Hi all,
>Here is my code
>
> data temp;
>coderun=datetime();
>job='Updating';
>lastcoderun=intnx('second',coderun,0);
>format coderun lastcoderun dtdate9.;
>run;
>
>now i am trying to insert this values into other table.
>
> proc sql;
> insert into table temp1 (jobname,coderun,lastcoderun)
> select values job,coderun,lastcoderun from temp;
> quit;
>
>if the output of temp1 table is thisway:
>
>job coderun lastcoderun
>Updating 25May2005 25May2005
>
>if i keep running the same above jobs after evary month my output should
>have these values .
>
> i want the values of lastcoderun to be previous value and the coderun
value
>to be current value ..how should i get this o/p
>
>job coderun lastcoderun
>
>Updating 25June2009 25May2009
>Inserting 25Jul2009 25Jun2009
>Deletion 25Sep2009 25Jul2009
>Creation 25Oct2009 25Sep2009
>
>I am unable to write code to store previous value of a variable and then
>populate it to new table.
>Hope i Have confused ,but still understand from the outputs mentioned .
>
>Thanks In Advance.
|