Last active
August 29, 2015 13:59
-
-
Save mjdescy/10643896 to your computer and use it in GitHub Desktop.
ACL Script To Pull Random Attribute Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMMENT Script: Pull random attribute sample. | |
COMMENT | |
Before using this script, | |
1. set the SampleSize variable; | |
2. replace "PopulationTable" with the population table name; and | |
3. replace "SampleTable" with the sample table name. | |
END | |
COMMENT Define sample size. | |
SampleSize = 77 | |
COMMENT Pull sample. | |
OPEN PopulationTable | |
COUNT | |
IF COUNT1 > SampleSize SAMPLE ON RECORD NUMBER SampleSize POPULATION COUNT1 RECORD TO "SampleTable" OPEN | |
IF COUNT1 <= SampleSize EXTRACT RECORD TO "SampleTable" OPEN | |
DEFINE FIELD SampleID COMPUTED RECNO() | |
DEFINE FIELD SampleName COMPUTED "Sample Name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment