Sergio,
You can use multiple OUTFIL statements with DFSORT or ICETOOL to write two files based on two different conditions. Here are examples with DFSORT and with ICETOOL. The exact job you would use depends on exactly what you want to do.
DFSORT job//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(8,1,CH,EQ,C'3')
OUTFIL FNAMES=OUT2,INCLUDE=(8,1,CH,EQ,C'4')
/*
DFSORT/ICETOOL job//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT1,INCLUDE=(8,1,CH,EQ,C'3')
OUTFIL FNAMES=OUT2,INCLUDE=(8,1,CH,EQ,C'4')
/*
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
http://www.ibm.com/servers/storage/supp ... tmpub.html