Dear List Members First of all I would like to convey my heartfelt thanks to all those who responded with suggestions/solution & syntax to my problem with the aggregate command. My apologies if i have not explained more clearly about my data file. Ariel Barak solution of using identifying duplicates, match sequence and select command does exactly what I need i.e to create a output data file that has a unique legalaction record for every eventrefnum and incidentnum based on the earliest legal action date. Here is how i did it using the menu : Ariel Barak Solution First sort cases by Erefnum and Inc ref num Click on * Identify Duplicate Cases. Define matching cases by Erefnum Increfnum Sort within matching groups by legactdate Click on primary first Click on sequential count of matching groups in each case This will create 2 variables primary first and match sequence Select if matchsequence =0. This will give all unique records where there is only one legalactdate for every eventref number/incidentrefnum. Save it as file 1. Select if match sequence not eq 0. This will give eventref and incref records with multiple legal act dates. Save this as file2. In file 2 select if primary first =1. Execute. This will give records where the legalactdate is the first. Save this as file 3. Than use match file add cases function to merge file1 and file3. This will give a unique file for all legal actions. While aggregate command helps me identify the earliest legal action date through the mode=add variables function - it does not help me select unique records to create a new datafile. Thank you once again. regards thara
|
Administrator
|
SORT CASES by primary_keys lower_key.
MATCH FILES / FILE * / BY primary_keys /FIRST=keep. DO IF keep. XSAVE OUTFILE 'unique earliest'. END IF. EXE. ---
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |