DATA Step, Macro, Functions and more

Copy from one Enviroment to other environment

Reply
Contributor
Posts: 33

Copy from one Enviroment to other environment

[ Edited ]

Dear Experts,

 

I don't have any idea where to start .Here is the situation, I have three different environemnt(development,Testing and Production).

How do I copy the data from developement to production and testing to production.moreover i want to compare the data are the same in all environments.

 

first i have to copy the data from development  database 2016  into developement database 2017.

 

%macro Env(server);

proc sql stimer;

connect to oledb as test2016 (provider = sqloledb

datasource = "&server"

user = "User Id"

password = "password"

properties = ('INITIAL CATALOG'=database2016)

dbmax_text = 30000);

 

connect to oledb as test2017 (provider = sqloledb

datasource = "&server"

user = "User Id"

password = "password"

properties = ('INITIAL CATALOG'=database2017)

dbmax_text = 30000);

 

select * from connection to test2016

(copy developemnt data to testing data

);

disconnect from test2016;

disconnect from test2017;

quit;

 

proc compare base=development compare=testing;run;

 

 

%mend ENV;

 

%ENV(Development);

%ENV(Testing);

%ENV(Production);

 

thanks

 

 

Regular Contributor
Posts: 177

Re: Copy from one Enviroment to other environment

It seems to me that you have your data in a SQL Server database and want to replicate that. I'm not any sort of SQL Server expert but to be honest I think you're better off using a native tool for that rather than using SAS to copy the data over. The likelihood is that you'll have issues with data type conversion and precision if you try to do it with SAS.

 

You might find the Microsoft Developer Network Pages helpful particularly https://msdn.microsoft.com/en-us/library/hh272696(v=vs.103).aspx

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 122 views
  • 1 like
  • 2 in conversation