Your question is vague, so my answer might be likewise and 'miss the mark.'
Because you asked about looping, I assume that you are scripting. You could also interactively assign all of the numeric data columns to the Y role after selecting Analyze > Distribution to get the mean of all the variables. You could right-click on one of the tables and select Make Into Combined Data Table.
Here is one scripted solution:
Names Default to Here( 1 );
dt = Current Data Table();
name = mean = List();
For( col = 1, col <= N Col( dt ), col++,
column = Column( dt, col );
type = column << Get Data Type;
If( type == "Numeric",
Insert Into( name, Eval( Column( dt, col ) << Get Name ) );
Insert Into( mean, Eval( Col Mean( Column( dt, col ) ) ) );
New Table( "Column Means",
New Column( "Name", "Character", "Nominal", Values( name ) ),
New Column( "Mean", "Numeric", "Continuous", Values( mean ) ),
You should take more time to fully explain what you are trying to do and what help you need when you start a discussion if you expect to get a good answer without a lot of iterations.