BookmarkSubscribeRSS Feed
sas_
Fluorite | Level 6

Moving Data HI actually i am having dates in one table cal
actually i am having stdate and enddate


data l(drop=sdt edt);
input sdt$ 1-9 edt$ 10-20;
stdate =input(sdt,date9.);
enddate=input(edt,date9.);
format s1 E1 ddmmyy10.;
cards;
12jan2011 13jan2011
13jan2011 14jan2011
14jan2011 15jan2011
15jan2011 16jan2011
16jan2011 17jan2011
17jan2011 18jan2011
run;

Actually i want the dates to got to one table with single observation as i run that it should move to another date like that

For Example the out put should be in another table with one obs so that i will resolve that
date in a macro and will make the infile

the date will be c:\raw\12012011\

so if i run that it will resolve to date 12012011 i will concatenae c:\raw\ to that

if i  again run the job it shoul go to 13012011 it will be c:\raw\13012011\


so if one single obs going to another table i will resove the date from that table

3 REPLIES 3
sas_
Fluorite | Level 6

Actually in the above table i will be having all the dates


now i want another table having one obs i that i will give the raw file path and concatenate it with the dates
and if again i rerun the job it should move to the next date and it will concatenate with the path..

Output in another table with single obs

Raw path  dt

c:\raw  12012011

If i again rerun it the output with single obs table should be

Raw path  dt

c:\raw  13012011

art297
Opal | Level 21

I don't understand what you are asking.  The code in your initial post in confusing as well.  Why don't you just read the dates in, directly, using the date9. informat?  And why do you format variables that you don't have?

More so, it would help for you to explain what your input file actually looks like, what file(s) you want as output, and what should be used as the decision rule(s).

sas_
Fluorite | Level 6

data l(drop=sdt edt);
input sdt$ 1-9 edt$ 10-20;
stdate =input(sdt,date9.);
enddate=input(edt,date9.);
format stdate enddate ddmmyy10.;
cards;
12jan2011 13jan2011
13jan2011 14jan2011
14jan2011 15jan2011
15jan2011 16jan2011
16jan2011 17jan2011
17jan2011 18jan2011
run;
proc print;
run;


see actually i the above table i have the dates on which the loading to be happened

In the second table in one cell i will have the Sdate and Edate so i want one table
with one obs of date so that

Ex:
Table 2
Sdate         Edate        Path      Data            Fpath
12012011    13012011   c/raw/    order.txt      c/raw/12012011/order.txt

I want the dates  to go to another table in the Infile path of the job i will
give Fpath in the macro so that it will take data from there daily

if the job again runs the date should increment so i will run for 13 date this is my aim
for the loading data based on date

Sdate         Edate        Path      Data            Fpath


13012011    14012011   c/raw/    order.txt      c/raw/13012011/order.txt

If it is messy refer the text file

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 821 views
  • 0 likes
  • 2 in conversation