Hi folks,
I have a dataset on historical fishery identifiers which has the following format:
I would like to expand the data to look like this, with a line for each relevant year captured in the "years" variable :
I know this is relatively easy to do via creating a range variable and using the expand command, but I am not sure how to make the year variable correctly cycle through the ranges for each permit in the new dataset.
Let me know. Thanks folks!
I have a dataset on historical fishery identifiers which has the following format:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str5 fishery str11 years str53 characteristics byte(v4 v5) "D 9CA" "1997 - 1998" "DUNGENESS CRAB , 150 POTS/OR 50% OF MAX, SOUTHEAST" . . "D 9BA" "1997 - 2001" "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" . . "D 9AA" "1997 - 2000" "DUNGENESS CRAB , 300 POTS/OR 100% OF MAX, SOUTHEAST" . . "D 12E" "1992" "DUNGENESS CRAB , DIVE/HAND PICK, PRINCE WILLIAM SOUND" . . "D 12A" "1992" "DUNGENESS CRAB , DIVE/HAND PICK, SOUTHEAST" . . "D 12B" "1983 - 1985" "DUNGENESS CRAB , DIVE/HAND PICK, STATEWIDE" . . end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str5 fishery int years str53 characteristics "D 9CA" 1997 "DUNGENESS CRAB , 150 POTS/OR 50% OF MAX, SOUTHEAST" "D 9CA" 1998 "DUNGENESS CRAB , 150 POTS/OR 50% OF MAX, SOUTHEAST" "D 9BA" 1997 "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" "D 9BA" 1998 "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" "D 9BA" 1999 "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" "D 9BA" 2000 "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" "D 9BA" 2001 "DUNGENESS CRAB , 225 POTS/OR 75% OF MAX, SOUTHEAST" "D 9AA" 1997 "DUNGENESS CRAB , 300 POTS/OR 100% OF MAX, SOUTHEAST" "D 9AA" 1998 "DUNGENESS CRAB , 300 POTS/OR 100% OF MAX, SOUTHEAST" "D 9AA" 1999 "DUNGENESS CRAB , 300 POTS/OR 100% OF MAX, SOUTHEAST" "D 9AA" 2000 "DUNGENESS CRAB , 300 POTS/OR 100% OF MAX, SOUTHEAST" "D 12E" 1992 "DUNGENESS CRAB , DIVE/HAND PICK, PRINCE WILLIAM SOUND" "D 12A" 1992 "DUNGENESS CRAB , DIVE/HAND PICK, SOUTHEAST" "D 12B" 1983 "DUNGENESS CRAB , DIVE/HAND PICK, STATEWIDE" "D 12B" 1984 "DUNGENESS CRAB , DIVE/HAND PICK, STATEWIDE" "D 12B" 1985 "DUNGENESS CRAB , DIVE/HAND PICK, STATEWIDE" end
Let me know. Thanks folks!
Comment