From edfaa67c3cacd7d9746330f9d4eed38cf5ecd8ab Mon Sep 17 00:00:00 2001 From: kbjarkefur Date: Tue, 19 Apr 2022 04:36:51 -0400 Subject: [PATCH 1/8] ietestform : confirm public key column before testing content --- src/ado_files/ietestform.ado | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ado_files/ietestform.ado b/src/ado_files/ietestform.ado index a4405cca..a24dc18b 100644 --- a/src/ado_files/ietestform.ado +++ b/src/ado_files/ietestform.ado @@ -232,9 +232,17 @@ qui { TEST - Encryption key not included/errors ***********************************************/ - *converting public_key to string to convert from numeric incase of missing public_key - tostring public_key, replace - local public_key = public_key[1] + *Testing if a variable pulbic_key at all exists + cap confirm variable public_key + if _rc { + local public_key = "" + } + *If varialbe exists, convert whatever value (or missing) to string + else { + tostring public_key, replace + local public_key = public_key[1] + } + cap assert !missing("`public_key'") From e7eadce010db9ea9138884fe79503edba197b419 Mon Sep 17 00:00:00 2001 From: Benjamin Daniels Date: Fri, 31 Mar 2023 15:27:39 -0400 Subject: [PATCH 2/8] Fix bad pause in iecodebook --- src/ado_files/iecodebook.ado | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ado_files/iecodebook.ado b/src/ado_files/iecodebook.ado index 6b6ed108..a2d85694 100644 --- a/src/ado_files/iecodebook.ado +++ b/src/ado_files/iecodebook.ado @@ -703,7 +703,6 @@ qui { } if "`: list allVars - theNameList'" != "" { if "`drop'" != "" { - pause local firstDrop "drop `: list allVars - theNameList'" } else { From 6cd4d94373ebfca8e515e08810ac0b7bd21a0eae Mon Sep 17 00:00:00 2001 From: Benjamin Daniels Date: Mon, 10 Apr 2023 14:07:06 -0400 Subject: [PATCH 3/8] Implement [trimkeep] Solve #254 --- src/ado_files/iecodebook.ado | 5 +++-- src/help_files/iecodebook.sthlp | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ado_files/iecodebook.ado b/src/ado_files/iecodebook.ado index 6b6ed108..b9d7dda9 100644 --- a/src/ado_files/iecodebook.ado +++ b/src/ado_files/iecodebook.ado @@ -158,7 +158,8 @@ cap program drop iecodebook_export program iecodebook_export syntax [anything] [using/] /// - , [replace] [save] [saveas(string asis)] [trim(string asis)] /// User-specified options + , [replace] [save] [saveas(string asis)] /// User-specified options + [trim(string asis)] [trimkeep(string asis)] /// User-specified options [SIGNature] [reset] [PLAINtext(string)] [noexcel] [verify] /// Signature and verify options [match] [template(string asis)] [tempfile] // Programming options @@ -274,7 +275,7 @@ qui { di as err "You are dropping all variables. This is not allowed. {bf:iecodebook} will now exit." error 198 } - keep `theKeepList' // Keep only variables mentioned in the dofiles + keep `theKeepList' `trimkeep' // Keep only variables mentioned in the dofiles } // End [trim] option // Prepare to save and sign diff --git a/src/help_files/iecodebook.sthlp b/src/help_files/iecodebook.sthlp index 121b2d1a..e8000be6 100644 --- a/src/help_files/iecodebook.sthlp +++ b/src/help_files/iecodebook.sthlp @@ -83,7 +83,7 @@ and optionally reduces the dataset to only the variables used in a set of specif {p 2 4}, [{bf:replace}] [{opt save}] [{bf:verify}] {break} [{opt sign:ature}] [{opt reset}] {break} [{opt plain:text}({it:compact} | {it:detailed})] [{opt noexcel}] {break} - [{bf:trim(}{it:"/path/to/dofile1.do"} [{it:"/path/to/dofile2.do"}] [...]{bf:)}]{p_end} + [{bf:trim(}{it:"/path/to/dofile1.do"} [{it:"/path/to/dofile2.do"}] [...]{bf:)}] [{opth trimkeep(varlist)}]{p_end} {hline} @@ -157,7 +157,7 @@ It will break with an error and describe all changes if there are any difference A new codebook will not be written in this case.{p_end} {break} {synopt:{opt plain:text}({it:compact} | {it:detailed})}This option requests that the codebook be created as a plaintext file. -This file contains the default output of {help codebook} if argument {it:detailed}} is used, +This file contains the default output of {help codebook} if argument {it:detailed}} is used, and the compact output of {help codebook} if argument {it:compact} is used. Only one of the arguments can be used}.{p_end} {synopt:{opt noexcel}}This option requests that the codebook be created as a plaintext file. @@ -174,6 +174,8 @@ or overwrite an existing datasignature.{p_end} {break} {synopt:{opt trim()}}This option takes one or more dofiles as inputs, and trims the current dataset to only include variables used in those dofiles, before executing any of the other {bf: export} tasks requested.{p_end} +{synopt:{opt trimkeep()}}This option adjusts {opt trim()} to retain additional +variables (such as ID variables) that are desired, but not used in code.{p_end} {synoptline} {marker example} From 6a0db1186a4a78af5cf1860a4e25480896b9ca09 Mon Sep 17 00:00:00 2001 From: Luiza Andrade Date: Mon, 31 Jul 2023 19:04:33 -0500 Subject: [PATCH 4/8] test #255 --- run/iecodebook.do | 231 ++++++++++++++++++++++++++-------------------- 1 file changed, 132 insertions(+), 99 deletions(-) diff --git a/run/iecodebook.do b/run/iecodebook.do index d2ee2461..fdb98b81 100644 --- a/run/iecodebook.do +++ b/run/iecodebook.do @@ -1,5 +1,5 @@ - qui do "${GitHub}/iefieldkit/src/ado_files/iecodebook.ado" + qui do "src/ado_files/iecodebook.ado" ******************************************************************************** **# Folder and format testing @@ -15,23 +15,23 @@ assert _rc == 601 * File does not exist - cap iecodebook apply using "${codebook}/auto_no_exist.xlsx" + cap iecodebook apply using "run/output/iecodebook/auto_no_exist.xlsx" assert _rc == 601 * Wrong file extension - cap iecodebook template using "${codebook}/auto.xsl" + cap iecodebook template using "run/output/iecodebook/auto.xsl" assert _rc == 601 - cap iecodebook apply using "${codebook}/auto.xsl" + cap iecodebook apply using "run/output/iecodebook/auto.xsl" assert _rc == 601 * No file extension - iecodebook template using "${codebook}/auto", replace - iecodebook apply using "${codebook}/auto" + iecodebook template using "run/output/iecodebook/auto", replace + iecodebook apply using "run/output/iecodebook/auto" * Make sure some subcommand is specified - cap iecodebook using "${codebook}/auto.xlsx" + cap iecodebook using "run/output/iecodebook/auto.xlsx" assert _rc == 197 ******************************************************************************** @@ -45,11 +45,11 @@ sysuse auto, clear * Create the file template - cap erase "${codebook}/auto.xlsx" - iecodebook template using "${codebook}/auto.xlsx" + cap erase "run/output/iecodebook/auto.xlsx" + iecodebook template using "run/output/iecodebook/auto.xlsx" * Replace option when the template already exists - iecodebook template using "${codebook}/auto.xlsx", replace + iecodebook template using "run/output/iecodebook/auto.xlsx", replace ******************************************** @@ -57,26 +57,26 @@ ******************************************** * Template already exists - cap iecodebook template using "${codebook}/auto.xlsx" + cap iecodebook template using "run/output/iecodebook/auto.xlsx" assert _rc == 602 * Non-template options - cap iecodebook template using "${codebook}/auto.xlsx", replace match + cap iecodebook template using "run/output/iecodebook/auto.xlsx", replace match assert _rc == 198 - cap iecodebook template using "${codebook}/auto.xlsx", replace gen(foo) + cap iecodebook template using "run/output/iecodebook/auto.xlsx", replace gen(foo) assert _rc == 198 - cap iecodebook template using "${codebook}/auto.xlsx", replace report + cap iecodebook template using "run/output/iecodebook/auto.xlsx", replace report assert _rc == 198 - cap iecodebook template using "${codebook}/auto.xlsx", replace keepall + cap iecodebook template using "run/output/iecodebook/auto.xlsx", replace keepall assert _rc == 198 - iecodebook template using "${codebook}/auto.xlsx", /// + iecodebook template using "run/output/iecodebook/auto.xlsx", /// replace missing(.d "Don't know") - iecodebook template using "${codebook}/auto.xlsx", replace drop + iecodebook template using "run/output/iecodebook/auto.xlsx", replace drop /*------------------------------------------------------------------------------ @@ -89,7 +89,7 @@ * Droping variables with blank var names using drop option sysuse auto, clear - iecodebook apply using "${codebook}/auto_drop.xlsx", drop + iecodebook apply using "run/output/iecodebook/auto_drop.xlsx", drop foreach var in make price mpg rep78 headroom trunk weight length { confirm variable `var' @@ -103,7 +103,7 @@ * Only by using blank var names without drop option, variables are not dropped. sysuse auto, clear - iecodebook apply using "${codebook}/auto_drop.xlsx" + iecodebook apply using "run/output/iecodebook/auto_drop.xlsx" foreach var in make price mpg rep78 headroom trunk weight length /// turn displacement gear_ratio foreign { @@ -113,7 +113,7 @@ * Drop variables with a dot in the "name" column sysuse auto, clear - iecodebook apply using "${codebook}/auto_dot.xlsx" + iecodebook apply using "run/output/iecodebook/auto_dot.xlsx" foreach var in make price mpg rep78 headroom trunk weight length { cap confirm variable `var' @@ -127,7 +127,7 @@ * Drop value labels with a dot in the "choices" column sysuse auto, clear - iecodebook apply using "${codebook}/auto_droplabel.xlsx" + iecodebook apply using "run/output/iecodebook/auto_droplabel.xlsx" local f0: label foreign 1 assert "`f0'"!= "Domestic" @@ -140,7 +140,7 @@ replace foreign = .n in 13 replace foreign = .o in 14 - iecodebook apply using "${codebook}/auto_missingvalues.xlsx", /// + iecodebook apply using "run/output/iecodebook/auto_missingvalues.xlsx", /// miss(.d "Don't know" .o "Other" .n "Not applicable") labelbook @@ -151,7 +151,7 @@ * Rename value labels sysuse auto, clear - iecodebook apply using "${codebook}/auto_addlabel.xlsx" + iecodebook apply using "run/output/iecodebook/auto_addlabel.xlsx" local f0: label foreign 0 assert "`f0'"== "False" local f1: label foreign 1 @@ -159,7 +159,7 @@ * Rename variables sysuse auto, clear - iecodebook apply using "${codebook}/auto_renaming.xlsx" + iecodebook apply using "run/output/iecodebook/auto_renaming.xlsx" foreach var in cost car_mpg rep78 { confirm variable `var' @@ -180,19 +180,19 @@ * Label variables sysuse auto, clear - iecodebook apply using "${codebook}/auto_labelling.xlsx" + iecodebook apply using "run/output/iecodebook/auto_labelling.xlsx" local p: var label price assert "`p'" == "Cost" * What if labels have weird blanks spaces? sysuse auto, clear lab drop origin - iecodebook apply using "${codebook}/auto_label_space.xlsx" + iecodebook apply using "run/output/iecodebook/auto_label_space.xlsx" * What if value labels are missing sysuse auto, clear lab drop origin - cap iecodebook apply using "${codebook}/auto_label_missing.xlsx" + cap iecodebook apply using "run/output/iecodebook/auto_label_missing.xlsx" assert _rc == 100 ************************** @@ -201,7 +201,7 @@ * Recode variables sysuse auto, clear - iecodebook apply using "${codebook}/auto_recode.xlsx" + iecodebook apply using "run/output/iecodebook/auto_recode.xlsx" assert displacement != 79 @@ -210,19 +210,19 @@ ******************************************** * Non-apply options - cap iecodebook apply using "${codebook}/auto.xlsx", keepall + cap iecodebook apply using "run/output/iecodebook/auto.xlsx", keepall assert _rc == 198 - cap iecodebook apply using "${codebook}/auto.xlsx", generate(new var) + cap iecodebook apply using "run/output/iecodebook/auto.xlsx", generate(new var) assert _rc == 198 - cap iecodebook apply using "${codebook}/auto.xlsx", generate(new var) + cap iecodebook apply using "run/output/iecodebook/auto.xlsx", generate(new var) assert _rc == 198 - cap iecodebook apply using "${codebook}/auto.xlsx", report + cap iecodebook apply using "run/output/iecodebook/auto.xlsx", report assert _rc == 198 - iecodebook apply using "${codebook}/auto.xlsx", replace + iecodebook apply using "run/output/iecodebook/auto.xlsx", replace @@ -239,20 +239,20 @@ save `auto1' * Simple run - cap erase "${codebook}/template_apply1.xlsx" - iecodebook template `auto1' `auto2' using "${codebook}/template_apply1.xlsx", /// + cap erase "run/output/iecodebook/template_apply1.xlsx" + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_apply1.xlsx", /// surveys(one two) * Run with replace - iecodebook template `auto1' `auto2' using "${codebook}/template_apply1.xlsx", /// + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_apply1.xlsx", /// surveys(one two) replace * Match - iecodebook template `auto1' `auto2' using "${codebook}/template_apply2.xlsx", /// + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_apply2.xlsx", /// surveys(one two) replace match * Gen - iecodebook template `auto1' `auto2' using "${codebook}/template_apply3.xlsx", /// + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_apply3.xlsx", /// surveys(one two) replace gen(oi) @@ -260,16 +260,16 @@ * Incorrect uses : error messages expected * ******************************************** * Survey option - cap iecodebook template `auto1' `auto2' using "${codebook}/template_error.xlsx", replace + cap iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_error.xlsx", replace assert _rc == 198 * Non-template options - iecodebook template `auto1' `auto2' using "${codebook}/template_error.xlsx", /// + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_error.xlsx", /// surveys(First Second) /// keepall replace - iecodebook template `auto1' `auto2' using "${codebook}/template_error.xlsx", /// + iecodebook template `auto1' `auto2' using "run/output/iecodebook/template_error.xlsx", /// surveys(First Second) /// report replace @@ -283,46 +283,46 @@ save `auto1' * Clear: required option - cap iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + cap iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// surveys(First Second) generate(survey_name) assert _rc == 4 * Survey: requiered option - cap iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + cap iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// clear replace assert _rc == 198 * Generate option - iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// clear /// surveys(First Second) /// generate(survey_name) /// report replace * Report option - cap erase "${codebook}/harmonization_report.xlsx" - iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + cap erase "run/output/iecodebook/harmonization_report.xlsx" + iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// clear surveys(First Second) report * Replace option - cap iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + cap iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// clear surveys(First Second) report assert _rc == 602 - iecodebook append `auto1' `auto2' using "${codebook}/harmonization.xlsx", /// + iecodebook append `auto1' `auto2' using "run/output/iecodebook/harmonization.xlsx", /// clear surveys(First Second) report replace * missingvalues option iecodebook append `auto1' `auto2' /// - using "${codebook}/harmonization_missing.xlsx", /// + using "run/output/iecodebook/harmonization_missing.xlsx", /// clear /// surveys(First Second Third) /// miss(.d "Don't know" .n "Not applicable") * keepall iecodebook append `auto1' `auto2' /// - using "${codebook}/harmonization_keep.xlsx", /// + using "run/output/iecodebook/harmonization_keep.xlsx", /// clear surveys(First Second) /// keepall replace @@ -333,21 +333,21 @@ * Survey option incorrect names cap iecodebook append `auto1' `auto2' /// - using "${codebook}/template_survey.xlsx", /// + using "run/output/iecodebook/template_survey.xlsx", /// clear surveys(Second name_incorrect) replace assert _rc == 198 * Survey option just one of the names cap iecodebook append `auto1' `auto2' /// - using "${codebook}/template_survey.xlsx", /// + using "run/output/iecodebook/template_survey.xlsx", /// clear surveys(First) replace assert _rc == 111 * Survey incorrect name order cap iecodebook append `auto1' `auto2' /// - using "${codebook}/harmonization.xlsx", /// + using "run/output/iecodebook/harmonization.xlsx", /// clear surveys(Second First) replace assert _rc == 198 @@ -356,35 +356,35 @@ ******************************************************************************** sysuse auto, clear - cap erase "${codebook}/auto_export.xlsx" - iecodebook export using "${codebook}/auto_export.xlsx" + cap erase "run/output/iecodebook/auto_export.xlsx" + iecodebook export using "run/output/iecodebook/auto_export.xlsx" ************************** * Replace * ************************** - iecodebook export using "${codebook}/auto_export.xlsx", replace + iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace ************************** * Signature option * ************************** * Should not work if there's no file and [reset] was not specified - cap erase "${codebook}/auto_export-sig.txt" - cap iecodebook export using "${codebook}/auto_export.xlsx", replace signature + cap erase "run/output/iecodebook/auto_export-sig.txt" + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace signature assert _rc == 601 * Create it - iecodebook export using "${codebook}/auto_export.xlsx", replace signature reset + iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace signature reset * Compare when no changes - iecodebook export using "${codebook}/auto_export.xlsx", replace signature + iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace signature * Compare when changes preserve * Drop variables drop in 1 - cap iecodebook export using "${codebook}/auto_export.xlsx", replace signature + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace signature assert _rc == 9 restore @@ -393,7 +393,7 @@ preserve gen new= make - cap iecodebook export using "${codebook}/auto_export.xlsx", replace signature + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace signature assert _rc == 9 restore @@ -403,19 +403,19 @@ * Textonly option * ************************** - iecodebook export using "${codebook}/auto_export.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// plain(detailed) replace * Compact output of codebook - iecodebook export using "${codebook}/auto_export.xlsx", /// // check values foreign variable + iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// // check values foreign variable plain(compact) replace * Detaild output of codebook - iecodebook export using "${codebook}/auto_export.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// plain(detailed) replace * Should not work if an incorrect argument is used - cap iecodebook export using "${codebook}/auto_export.xlsx", /// + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// plain(dalk) replace assert _rc == 198 @@ -424,16 +424,16 @@ * noexcel * ************************** - iecodebook export using "${codebook}/auto_export.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// plain(compact) replace noexcel * Should not work if [plaintext] was not specified - cap iecodebook export using "${codebook}/auto_export.xlsx", /// + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", /// replace noexcel assert _rc == 198 * Should not work if [noexcel] and [verify] options are combined - cap iecodebook export using "${codebook}/auto_export.xlsx", verify noexcel // Drop data + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", verify noexcel // Drop data assert _rc == 184 @@ -441,15 +441,15 @@ * verify * ************************** sysuse auto, clear - iecodebook export using "${codebook}/auto_export.xlsx", replace + iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace * Verified existing codebook and data structure to match sysuse auto, clear - iecodebook export using "${codebook}/auto_export.xlsx", verify + iecodebook export using "run/output/iecodebook/auto_export.xlsx", verify * Should keep data if we use a export file that doesn't exist // Drop data sysuse auto, clear - cap iecodebook export using "${codebook}/auto_export_no_exist.xlsx", verify + cap iecodebook export using "run/output/iecodebook/auto_export_no_exist.xlsx", verify assert _rc == 601 * Compare when changes data @@ -457,7 +457,7 @@ preserve drop mpg - cap iecodebook export using "${codebook}/auto_export.xlsx", verify + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", verify assert _rc == 7 restore @@ -465,7 +465,7 @@ preserve label drop origin - cap iecodebook export using "${codebook}/auto_export.xlsx", verify replace // verify variables? + cap iecodebook export using "run/output/iecodebook/auto_export.xlsx", verify replace // verify variables? assert _rc == 7 restore @@ -481,17 +481,17 @@ * The data should be saved at the same location as the codebook, with the same name as the codebook - iecodebook export `auto' using "${codebook}/auto_export.xlsx", replace save + iecodebook export `auto' using "run/output/iecodebook/auto_export.xlsx", replace save * Should not work if data already exists and [replace] option was not specified - cap erase "${codebook}/auto_export.xlsx" - cap iecodebook export "${codebook}/auto" using "${codebook}/auto_export.xlsx", save + cap erase "run/output/iecodebook/auto_export.xlsx" + cap iecodebook export "run/output/iecodebook/auto" using "run/output/iecodebook/auto_export.xlsx", save assert _rc == 602 * The data should be saved at the specified location, overwriting the codebook name. - iecodebook export `auto' using "${codebook}/auto_export.xlsx", replace saveas("${codebook}/auto_data") + iecodebook export `auto' using "run/output/iecodebook/auto_export.xlsx", replace saveas("run/output/iecodebook/auto_data") - iecodebook export `auto' using "${codebook}/auto_export.xlsx", replace saveas("${codebook}/auto_new") + iecodebook export `auto' using "run/output/iecodebook/auto_export.xlsx", replace saveas("run/output/iecodebook/auto_new") @@ -501,58 +501,91 @@ lab var make "É" lab def origin 0 "ã & @" 1 "ã" , replace - iecodebook export using "${codebook}/auto_export.xlsx", replace + iecodebook export using "run/output/iecodebook/auto_export.xlsx", replace ************************ * Trim * ************************ sysuse auto, clear - iecodebook export using "${codebook}/auto_export_trim.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// replace /// - trim("${codebook}/iecodebook_trim1.do" /// - "${codebook}/iecodebook_trim2.do") + trim("run/output/iecodebook/iecodebook_trim1.do" /// + "run/output/iecodebook/iecodebook_trim2.do") sysuse auto, clear - iecodebook export using "${codebook}/auto_export_trim.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// replace /// - trim("${codebook}/iecodebook_trim1.do" /// - "${codebook}/iecodebook_trim2.do") /// + trim("run/output/iecodebook/iecodebook_trim1.do" /// + "run/output/iecodebook/iecodebook_trim2.do") /// save - use "${codebook}/auto_export_trim.dta", clear + use "run/output/iecodebook/auto_export_trim.dta", clear qui ds assert r(varlist) == "price mpg weight length gear_ratio foreign" sysuse auto, clear - iecodebook export using "${codebook}/auto_export_trim.xlsx", /// + iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// replace /// - trim("${codebook}/iecodebook_trim1.do") /// + trim("run/output/iecodebook/iecodebook_trim1.do") /// save - use "${codebook}/auto_export_trim.dta", clear + use "run/output/iecodebook/auto_export_trim.dta", clear qui ds assert r(varlist) == "price mpg weight length foreign" * Check for dofile correct extension sysuse auto, clear - cap iecodebook export using "${codebook}/auto_export_trim.xlsx", replace /// - trim("${codebook}/iecodebook_trim1.xlm") + cap iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", replace /// + trim("run/output/iecodebook/iecodebook_trim1.xlm") assert _rc == 610 + sysuse auto, clear + iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// + replace /// + trim("run/output/iecodebook/iecodebook_trim1.do" /// + "run/output/iecodebook/iecodebook_trim2.do") /// + trimkeep(make) /// + save + + use "run/output/iecodebook/auto_export_trim.dta", clear + qui ds + assert r(varlist) == "make price mpg weight length gear_ratio foreign" + + sysuse auto, clear + cap iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// + replace /// + trim("run/output/iecodebook/iecodebook_trim1.do" /// + "run/output/iecodebook/iecodebook_trim2.do") /// + trimkeep(foo) /// + save + + assert _rc == 111 + + sysuse auto, clear + cap iecodebook export using "run/output/iecodebook/auto_export_trim.xlsx", /// + replace /// + trim("run/output/iecodebook/iecodebook_trim1.do" /// + "run/output/iecodebook/iecodebook_trim2.do") /// + trimkeep(make turn) /// + save + use "run/output/iecodebook/auto_export_trim.dta", clear + qui ds + assert r(varlist) == "make price mpg weight length turn gear_ratio foreign" + ************************** * use * // This is not in the help files ************************** clear - iecodebook export "${codebook}/auto.dta" /// - using "${codebook}/auto_export.xlsx", /// + iecodebook export "run/output/iecodebook/auto.dta" /// + using "run/output/iecodebook/auto_export.xlsx", /// replace * Should not work if data doesnt exist clear - cap iecodebook export "${codebook}/dat.dta" using /// - "${codebook}/auto_export.xslx", /// + cap iecodebook export "run/output/iecodebook/dat.dta" using /// + "run/output/iecodebook/auto_export.xslx", /// replace assert _rc == 601 @@ -562,17 +595,17 @@ * Single dataset sysuse auto, clear - cap iecodebook apply using "${codebook}/auto_incomplete_vars.xlsx" + cap iecodebook apply using "run/output/iecodebook/auto_incomplete_vars.xlsx" assert _rc == 198 * Append cap iecodebook append `auto1' `auto2' /// - using "${codebook}/append_incomplete_vars.xlsx", /// + using "run/output/iecodebook/append_incomplete_vars.xlsx", /// surveys(one two) keepall clear assert _rc == 198 iecodebook append `auto1' `auto2' /// - using "${codebook}/append_incomplete_vars.xlsx", /// + using "run/output/iecodebook/append_incomplete_vars.xlsx", /// surveys(one two) clear ***************************************************************** End of do-file From f2e33d1109b8315a7df8d436185da2432c693f60 Mon Sep 17 00:00:00 2001 From: Luiza Andrade Date: Mon, 31 Jul 2023 19:19:13 -0500 Subject: [PATCH 5/8] test in Windows did not test ietestform --- run/output/iecorrect/hyphen-id.do | 2 +- run/output/iecorrect/iecorrect-missingid.do | 2 +- run/output/iecorrect/iecorrect-multiple-ids.do | 2 +- run/output/iecorrect/iecorrect-nobs.do | 2 +- run/output/iecorrect/iecorrect-precision.do | 2 +- run/output/iecorrect/iecorrect-simple-num-id-drop.do | 2 +- run/output/iecorrect/iecorrect-simple-num-id-numeric.do | 2 +- run/output/iecorrect/iecorrect-simple-num-id-string.do | 2 +- run/output/iecorrect/iecorrect-simple-num-id.do | 2 +- run/output/iecorrect/iecorrect-template-single-id.do | 2 +- run/output/iecorrect/iecorrect-test-idcond.do | 2 +- run/output/iecorrect/iecorrect-wildcard-strings.do | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/run/output/iecorrect/hyphen-id.do b/run/output/iecorrect/hyphen-id.do index 597a34ee..6ae8f319 100644 --- a/run/output/iecorrect/hyphen-id.do +++ b/run/output/iecorrect/hyphen-id.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:21 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:43 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-missingid.do b/run/output/iecorrect/iecorrect-missingid.do index 2b9973e5..c52df200 100644 --- a/run/output/iecorrect/iecorrect-missingid.do +++ b/run/output/iecorrect/iecorrect-missingid.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:43 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-multiple-ids.do b/run/output/iecorrect/iecorrect-multiple-ids.do index 2b9973e5..c52df200 100644 --- a/run/output/iecorrect/iecorrect-multiple-ids.do +++ b/run/output/iecorrect/iecorrect-multiple-ids.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:43 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-nobs.do b/run/output/iecorrect/iecorrect-nobs.do index af64c3cf..7dfd80ef 100644 --- a/run/output/iecorrect/iecorrect-nobs.do +++ b/run/output/iecorrect/iecorrect-nobs.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-precision.do b/run/output/iecorrect/iecorrect-precision.do index cc34d58f..cfe6a76c 100644 --- a/run/output/iecorrect/iecorrect-precision.do +++ b/run/output/iecorrect/iecorrect-precision.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:19 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-simple-num-id-drop.do b/run/output/iecorrect/iecorrect-simple-num-id-drop.do index 9109a948..40272437 100644 --- a/run/output/iecorrect/iecorrect-simple-num-id-drop.do +++ b/run/output/iecorrect/iecorrect-simple-num-id-drop.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-simple-num-id-numeric.do b/run/output/iecorrect/iecorrect-simple-num-id-numeric.do index 8bf0e3c8..46e24a3a 100644 --- a/run/output/iecorrect/iecorrect-simple-num-id-numeric.do +++ b/run/output/iecorrect/iecorrect-simple-num-id-numeric.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:19 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-simple-num-id-string.do b/run/output/iecorrect/iecorrect-simple-num-id-string.do index 9e092975..3c627c57 100644 --- a/run/output/iecorrect/iecorrect-simple-num-id-string.do +++ b/run/output/iecorrect/iecorrect-simple-num-id-string.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:19 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-simple-num-id.do b/run/output/iecorrect/iecorrect-simple-num-id.do index f928927a..b112c76f 100644 --- a/run/output/iecorrect/iecorrect-simple-num-id.do +++ b/run/output/iecorrect/iecorrect-simple-num-id.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:21 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:44 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-template-single-id.do b/run/output/iecorrect/iecorrect-template-single-id.do index a1e0070b..ee80d545 100644 --- a/run/output/iecorrect/iecorrect-template-single-id.do +++ b/run/output/iecorrect/iecorrect-template-single-id.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:19 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-test-idcond.do b/run/output/iecorrect/iecorrect-test-idcond.do index 4a406f5e..138d3ec3 100644 --- a/run/output/iecorrect/iecorrect-test-idcond.do +++ b/run/output/iecorrect/iecorrect-test-idcond.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:42 ==============================================================================*/ diff --git a/run/output/iecorrect/iecorrect-wildcard-strings.do b/run/output/iecorrect/iecorrect-wildcard-strings.do index e9ed7f93..1069e335 100644 --- a/run/output/iecorrect/iecorrect-wildcard-strings.do +++ b/run/output/iecorrect/iecorrect-wildcard-strings.do @@ -1,6 +1,6 @@ /*============================================================================== This do-file was created using iecorrect -Last updated by luizaandrade on 6 Feb 2023 at 11:19:20 +Last updated by luizaandrade on 31 Jul 2023 at 19:15:43 ==============================================================================*/ From 9e92c22def46417518dca72d6edc758b55d24ad3 Mon Sep 17 00:00:00 2001 From: Luiza Andrade Date: Mon, 31 Jul 2023 19:22:31 -0500 Subject: [PATCH 6/8] #256 update version numbers --- src/ado_files/iecodebook.ado | 2 +- src/ado_files/iecompdup.ado | 2 +- src/ado_files/iecorrect.ado | 2 +- src/ado_files/ieduplicates.ado | 2 +- src/ado_files/iefieldkit.ado | 2 +- src/ado_files/ietestform.ado | 2 +- src/help_files/iecodebook.sthlp | 2 +- src/help_files/iecompdup.sthlp | 2 +- src/help_files/iecorrect.sthlp | 2 +- src/help_files/ieduplicates.sthlp | 2 +- src/help_files/iefieldkit.sthlp | 2 +- src/help_files/ietestform.sthlp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ado_files/iecodebook.ado b/src/ado_files/iecodebook.ado index 4e3b34f9..ba0e8a04 100644 --- a/src/ado_files/iecodebook.ado +++ b/src/ado_files/iecodebook.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org // Main syntax --------------------------------------------------------------------------------- diff --git a/src/ado_files/iecompdup.ado b/src/ado_files/iecompdup.ado index aed2624f..14ed4a2e 100644 --- a/src/ado_files/iecompdup.ado +++ b/src/ado_files/iecompdup.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org capture program drop iecompdup program iecompdup , rclass diff --git a/src/ado_files/iecorrect.ado b/src/ado_files/iecorrect.ado index 25535b8b..6ccfe1e2 100644 --- a/src/ado_files/iecorrect.ado +++ b/src/ado_files/iecorrect.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org cap program drop iecorrect program iecorrect diff --git a/src/ado_files/ieduplicates.ado b/src/ado_files/ieduplicates.ado index 62e66009..08c2b11b 100644 --- a/src/ado_files/ieduplicates.ado +++ b/src/ado_files/ieduplicates.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org capture program drop ieduplicates program ieduplicates , rclass diff --git a/src/ado_files/iefieldkit.ado b/src/ado_files/iefieldkit.ado index 92e90d6e..4c66d1e6 100644 --- a/src/ado_files/iefieldkit.ado +++ b/src/ado_files/iefieldkit.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org capture program drop iefieldkit program iefieldkit, rclass diff --git a/src/ado_files/ietestform.ado b/src/ado_files/ietestform.ado index 35b6fa6a..53e68a07 100644 --- a/src/ado_files/ietestform.ado +++ b/src/ado_files/ietestform.ado @@ -1,4 +1,4 @@ -*! version 3.1 7JAN2023 DIME Analytics dimeanalytics@worldbank.org +*! version 3.2 31JUL2023 DIME Analytics dimeanalytics@worldbank.org capture program drop ietestform program ietestform , rclass diff --git a/src/help_files/iecodebook.sthlp b/src/help_files/iecodebook.sthlp index e8000be6..de059273 100644 --- a/src/help_files/iecodebook.sthlp +++ b/src/help_files/iecodebook.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:iecodebook} {hline} diff --git a/src/help_files/iecompdup.sthlp b/src/help_files/iecompdup.sthlp index f1ad9e60..6dea013d 100644 --- a/src/help_files/iecompdup.sthlp +++ b/src/help_files/iecompdup.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:iecompdup} {hline} diff --git a/src/help_files/iecorrect.sthlp b/src/help_files/iecorrect.sthlp index 24f29b58..d76d6887 100644 --- a/src/help_files/iecorrect.sthlp +++ b/src/help_files/iecorrect.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:iecorrect} {hline} diff --git a/src/help_files/ieduplicates.sthlp b/src/help_files/ieduplicates.sthlp index fdc75434..bd070c30 100644 --- a/src/help_files/ieduplicates.sthlp +++ b/src/help_files/ieduplicates.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:ieduplicates} {hline} diff --git a/src/help_files/iefieldkit.sthlp b/src/help_files/iefieldkit.sthlp index bd4d857d..fef63a9e 100644 --- a/src/help_files/iefieldkit.sthlp +++ b/src/help_files/iefieldkit.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:iefieldkit} {hline} diff --git a/src/help_files/ietestform.sthlp b/src/help_files/ietestform.sthlp index ae20952b..dac0c475 100644 --- a/src/help_files/ietestform.sthlp +++ b/src/help_files/ietestform.sthlp @@ -1,5 +1,5 @@ {smcl} -{* 7 Jan 2023}{...} +{* 31 Jul 2023}{...} {hline} help for {hi:ietestform} {hline} From dddcd98d1edabbc350d4c71c5844250887790e00 Mon Sep 17 00:00:00 2001 From: Luiza Andrade Date: Mon, 31 Jul 2023 19:23:35 -0500 Subject: [PATCH 7/8] #256 update iefieldkit locals --- src/ado_files/iefieldkit.ado | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ado_files/iefieldkit.ado b/src/ado_files/iefieldkit.ado index 4c66d1e6..fe052753 100644 --- a/src/ado_files/iefieldkit.ado +++ b/src/ado_files/iefieldkit.ado @@ -4,8 +4,8 @@ capture program drop iefieldkit program iefieldkit, rclass * UPDATE THESE LOCALS FOR EACH NEW VERSION PUBLISHED - local version "3.1" - local versionDate "7JAN2023" + local version "3.2" + local versionDate "31JUL2023" syntax [anything] From 3be59dd8edb73873a0f3c4f130fbf4612b199c38 Mon Sep 17 00:00:00 2001 From: Luiza Andrade Date: Mon, 31 Jul 2023 19:24:11 -0500 Subject: [PATCH 8/8] #256 update pkg and toc --- src/iefieldkit.pkg | 2 +- src/stata.toc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iefieldkit.pkg b/src/iefieldkit.pkg index d71f1fca..cb800f33 100644 --- a/src/iefieldkit.pkg +++ b/src/iefieldkit.pkg @@ -1,4 +1,4 @@ -v 3.1 +v 3.2 d iefieldkit. DIME Analytics iefieldkit d DIME Analytics, World Bank Group, Development Economics Research f /ado_files/iefieldkit.ado diff --git a/src/stata.toc b/src/stata.toc index 41133b5a..354ba5af 100644 --- a/src/stata.toc +++ b/src/stata.toc @@ -1,3 +1,3 @@ -v 3.1 +v 3.2 d DIME Analytics, World Bank Group, Development Economics Research p iefieldkit DIME Analytics iefieldkit