Suggest you explore using the SAS DATA step technique with multiple OUTPUTs, one for each file, and as you mentioned, using IF FIRST. to increment a count variable. Then use the SAS OUTPUT statement to send an observation to an output file name based on the incrementing variable. Then code your PROC PRINT steps, one for each split-file.
Another option is using SAS MACRO language concept with a macro coded using %DO and %END; to process your input records and generate "n" output files. A list of COUNTRY values can be generated with PROC SQL, generating a list of SAS macro variables, for which you would process each in your macro to create a split-file, and then print it.
The SAS support website http://support.sas.com/ has SAS hosted documentation, and also there are technical papers on this type of topic. Suggest you consider using the SEARCH facility at the website to identify references related to your post and also check the archives for this forum.
Here is one of the technical conference papers I found using the SAS support website SEARCH facility:
WHAT WOULD I DO WITHOUT PROC SQL AND THE MACRO LANGUAGE
Jeff Abolafia, Rho, Inc., Chapel Hill, NC
http://www2.sas.com/proceedings/sugi30/031-30.pdf
SAS MACRO language -- Using PROC SQL with the SAS Macro Facility
http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a001360983.htm
-- Creating and Using Macro Variables
http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a002595788.htm
Suggest developing a SAS program to accomplish your objective, re-post a reply with the code, for feedback from the forum.
Scott Barry
SBBWorks, Inc.
... View more