Of course, Billyboyo's little example could be "optimized" by specifying
//OUT DD DUMMY
Huh? That makes no sense. If you don't need to see the count in the OUT data set, then you would just use:
//CTRCDS EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...input file
//TOOLIN DD *
COUNT FROM(IN)
/*
DFSORT displays the count in TOOLMSG.
If you want the count in a data set, then you would use WRITE(OUT) with a //OUT DD you could look at (not DUMMY).