First, disclaimers: I'm new to Focus and didn't use the ASFOCA procedure in SIS.
This problem has been on my todo list for a while and this is the logic I plan to use:
1. Get the PIDMs of all the students you want. Store in HOLD1
2. Combine all the address types for each student in HOLD1 to one field.
ATYPES /A50 = IF (SFRSTCR_PIDM EQ LAST SFRSTCR_PIDM) THEN (SPRADDR_ATYP_CODE||'_'||SUBSTR(30,ATYPES,1,30,30,'A30')) ELSE SPRADDR_ATYP_CODE||'_';
3. Store PIDM and combined address types field in HOLD2
4. Join HOLD2 to SPRADDR. Create another hold file (HOLD3) with just PIDM and TYPE2USE testing for address type priority.
Address type testing is done in priority of importance. BI is more important than MA, etc.
TYPE2USE /A25 = IF (ATYPES CONTAINS 'BI_') THEN 'BI' ELSE
IF (ATYPES CONTAINS 'MA_') THEN 'MA' ELSE
IF (ATYPES CONTAINS 'AH_') THEN 'AH' ELSE
'Types Wanted Not Found' ;
5. Join HOLD3 back to SPRADDR where (SPRADDR_ATYP_CODE EQ TYPE2USE)
6. Planned to search for 'Types Wanted Not Found' to generate an exception report.
Lots of details left out but I had this about 80% complete the last time I worked on it.
Mike Honeycutt
honeycutt@unca.edu
UNC Asheville
WebFocus 7.6.6, Windows