Dear Ladies and Gentlemen,
this is a very basic question. I have been working with my laptop on my research project which utilizes the panel data set Understanding Society, UK.
Since I am now using restricted data, I must store the set on a Uni PC. When I use the command lines below, I get the error message (note: file awave.dta not found)
file awave.dta could not be opened. When I use my laptop with the unrestricted data set, the coding works just fine. My guess is that I make a very obvious (to you) mistake.
Would really appreciate some enlightment from you!
Cheers.
Nico
My command line from do file
version 11
clear all
set more off
capture log close
global Stata11_se "P:\Data\stata\stata11_se"
global Mergeddata_master2016 "P:\Mergeddata_master2016"
global Dofiles_master2016 "P:\Dofiles_master2016"
global Logfiles_master2016 "P:\Logfiles_master2016"
************************************************** ******
foreach w in a b c d e{
use `w'_ukborn pidp `w'_pno `w'_istrtdaty `w'_plbornc `w'_jbhrs `w'_qfhigh `w'_qualoc `w'_sex `w'_dvage `w'_marstat `w'_fimngrs_dv `w'_fimnlabgrs_dv `w'_jbstat ///
`w'_paygu_dv `w'_oprlg `w'_yr2uk4 `w'_birthy `w'_feend `w'_scend `w'_jbterm1 `w'_jbsize `w'_jbsect `w'_jbsectpub `w'_racel `w'_jbbgy `w'_sf1 `w'_jbmngr `w'_lnprnt `w'_jbsemp ///
`w'_gor_dv `w'_urban_dv `w'_jshrs ///
using "$Stata11_se/`w'_indresp_protect", clear
gen wave = strpos("abcde","`w'")
renpfix `w'_
save `w'wave, replace
}
foreach w in a b c d{
append using `w'wave.dta
}
sort pidp wave
save $Mergeddata_master2016\abcde_long, replace
foreach w in a b c d e{
erase `w'wave.dta
}
Stata's response when I run the do file:
global Stata11_se "P:\Data\stata\stata11_se"
. global Mergeddata_master2016 "P:\Mergeddata_master2016"
. global Dofiles_master2016 "P:\Dofiles_master2016"
. global Logfiles_master2016 "P:\Logfiles_master2016"
.
.
.
.
. ************************************************** ******
.
. foreach w in a b c d e{
2.
.
. use `w'_ukborn pidp `w'_pno `w'_istrtdaty `w'_plbornc `w'_jbhrs `w'_qfhigh `w'_qualoc `w'_sex `w'_dvage `w'_marstat `w'_fimngrs_dv `w'_fimnlabgrs_dv `w'_jbstat ///
> `w'_paygu_dv `w'_oprlg `w'_yr2uk4 `w'_birthy `w'_feend `w'_scend `w'_jbterm1 `w'_jbsize `w'_jbsect `w'_jbsectpub `w'_racel `w'_jbbgy `w'_sf1 `w'_jbmngr `w'_lnprnt
> `w'_jbsemp ///
> `w'_gor_dv `w'_urban_dv `w'_jshrs ///
> using "$Stata11_se/`w'_indresp_protect", clear
3.
.
. gen wave = strpos("abcde","`w'")
4.
.
. renpfix `w'_
5.
. save `w'wave, replace
6. }
(note: file awave.dta not found)
file awave.dta could not be opened
this is a very basic question. I have been working with my laptop on my research project which utilizes the panel data set Understanding Society, UK.
Since I am now using restricted data, I must store the set on a Uni PC. When I use the command lines below, I get the error message (note: file awave.dta not found)
file awave.dta could not be opened. When I use my laptop with the unrestricted data set, the coding works just fine. My guess is that I make a very obvious (to you) mistake.
Would really appreciate some enlightment from you!
Cheers.
Nico
My command line from do file
version 11
clear all
set more off
capture log close
global Stata11_se "P:\Data\stata\stata11_se"
global Mergeddata_master2016 "P:\Mergeddata_master2016"
global Dofiles_master2016 "P:\Dofiles_master2016"
global Logfiles_master2016 "P:\Logfiles_master2016"
************************************************** ******
foreach w in a b c d e{
use `w'_ukborn pidp `w'_pno `w'_istrtdaty `w'_plbornc `w'_jbhrs `w'_qfhigh `w'_qualoc `w'_sex `w'_dvage `w'_marstat `w'_fimngrs_dv `w'_fimnlabgrs_dv `w'_jbstat ///
`w'_paygu_dv `w'_oprlg `w'_yr2uk4 `w'_birthy `w'_feend `w'_scend `w'_jbterm1 `w'_jbsize `w'_jbsect `w'_jbsectpub `w'_racel `w'_jbbgy `w'_sf1 `w'_jbmngr `w'_lnprnt `w'_jbsemp ///
`w'_gor_dv `w'_urban_dv `w'_jshrs ///
using "$Stata11_se/`w'_indresp_protect", clear
gen wave = strpos("abcde","`w'")
renpfix `w'_
save `w'wave, replace
}
foreach w in a b c d{
append using `w'wave.dta
}
sort pidp wave
save $Mergeddata_master2016\abcde_long, replace
foreach w in a b c d e{
erase `w'wave.dta
}
Stata's response when I run the do file:
global Stata11_se "P:\Data\stata\stata11_se"
. global Mergeddata_master2016 "P:\Mergeddata_master2016"
. global Dofiles_master2016 "P:\Dofiles_master2016"
. global Logfiles_master2016 "P:\Logfiles_master2016"
.
.
.
.
. ************************************************** ******
.
. foreach w in a b c d e{
2.
.
. use `w'_ukborn pidp `w'_pno `w'_istrtdaty `w'_plbornc `w'_jbhrs `w'_qfhigh `w'_qualoc `w'_sex `w'_dvage `w'_marstat `w'_fimngrs_dv `w'_fimnlabgrs_dv `w'_jbstat ///
> `w'_paygu_dv `w'_oprlg `w'_yr2uk4 `w'_birthy `w'_feend `w'_scend `w'_jbterm1 `w'_jbsize `w'_jbsect `w'_jbsectpub `w'_racel `w'_jbbgy `w'_sf1 `w'_jbmngr `w'_lnprnt
> `w'_jbsemp ///
> `w'_gor_dv `w'_urban_dv `w'_jshrs ///
> using "$Stata11_se/`w'_indresp_protect", clear
3.
.
. gen wave = strpos("abcde","`w'")
4.
.
. renpfix `w'_
5.
. save `w'wave, replace
6. }
(note: file awave.dta not found)
file awave.dta could not be opened
Comment