fill fields from COMMENT LEGAL file
I'm studying the copydata example to learn how to extract several variables from a file identified in a COMMENT LEGAL statement. In A3.chk, the statement "TYPE COMMENT atransfer" appears. What is atransfer? I don't see where it has been defined as a variable and I don't find it as a system variable. Further, the program seems to be parsing the string in atransfer according to the position of punctuation. Where is the format of this string defined?
Perhaps to be a bit more explicit: I have file with a list of CHWs: District, Village, CHW name and a survey conducted by the CHWs. As the data is entered for the survey, I'd like to present pick lists to facilitate entry. The data is quite strictly hierarchical: Villages occur within Districts, an CHWs live in villages.
Thank you,
The field atransfer is defined in A3.QES. The flow of data in the A3 - B3 example is:
Enter data in B3.rec B3.chk takes 3 variables (age, sex, dob) and formats them into variable tvar as age:sex:dob
Enter data into A3.rec A3.chk treats tvar (in B3.rec) as the comment value that goes with the variable ID and saves that in variable atransfer Take apart atransfer by checking where the colons are
You applications sounds more like the example in the help file for check commands, but your situation may be too complex for this to work well. Examples of comment legal in IF..THEN structures V1 {User selects a country} COMMENT LEGAL 1 USA 2 CANADA END END. V2 {User selects a state} END IF V1=1 THEN COMMENT LEGAL 1 Alabama 2 ”New York” 3 Nevada 4 Oklahoma ..... END ENDIF IF V1=2 THEN COMMENT LEGAL 1 ”Nova Scotia” 2 Quebec END ENDIF END
I do not think there is any other way for you to filter a list (the list of all village names) based on the entered value of another variable (the district).
However, if what gets entered is the CHW name and you want to automatically fill in District and Village that match, then the copydata example will work.
Jamie
On 2011-05-31, at 5:32 PM, epidata-list@lists.umanitoba.ca wrote:
I'm studying the copydata example to learn how to extract several variables from a file identified in a COMMENT LEGAL statement. In A3.chk, the statement "TYPE COMMENT atransfer" appears. What is atransfer? I don't see where it has been defined as a variable and I don't find it as a system variable. Further, the program seems to be parsing the string in atransfer according to the position of punctuation. Where is the format of this string defined?
Perhaps to be a bit more explicit: I have file with a list of CHWs: District, Village, CHW name and a survey conducted by the CHWs. As the data is entered for the survey, I'd like to present pick lists to facilitate entry. The data is quite strictly hierarchical: Villages occur within Districts, an CHWs live in villages.
participants (1)
-
epidata-list@lists.umanitoba.ca