10-18-2015 06:05 PM
Please a want to create one log file for all the treatement ( log_all_trt.txt) and a log file file for every sub-treatement ( log_treatement_1.txt, log_treatement_2.txt....)
I want this treatement to be in log file: log_all_trt.txt
proc print data=toto; run; = => I want this treatement to be in log file : log_treatement_1.txt
proc compare base=t1 comp=t2; run; => I want this treatement to be in log file : log_treatement_2.txt
10-19-2015 06:38 AM
Well, there are a couple of points in there. Firstly why do you want to split a log - which is the description of a program run, not data - based on data? This doesn't make sense. If you want to create output files on a by group within your data, then do that in proc report. Now saying that, to split it out into different files, you would need to create a loop over the distinct treatment values:
create table LOOP as
select distinct TRT
call execute(cats('%print_data (indat=have,rep_name=report_',trt,',whre=',trt,');');
The above code will create a call to print data macro for each trt. Something like that can be used to create any output files (e.g. log), however personall I wouldn't associate a log - again which is a run of code - with a data report.
10-19-2015 03:39 PM
I'm not sure of what platform you are running this on, but if you are using mainframe Z/OS, you might consider having one subtreatment in a generational file and then at the end in a separate JCL step, you might concatenate the gdgs into one dataset through a SyncSort - Copy option and you will have all subtreatments combined to one master dataset.
The individual generations will be pointing to sub-treatments and the output of the SyncSort copy will hold the master data that includes all subtreatments.
If you are running in a Unix platform, you might use a concatenation utility to do what Syncsort does on the mainframe.
Hope this helps...!!!