Re: Using BY statement in ASReml

From: <arthur.gilmour_at_DPI.NSW.GOV.AU>
Date: Thu, 1 Nov 2007 12:57:10 +1100

Dear Denis,

Hello all,
I was wondering if there was an equivalent statement to the SAS 'by'
statement. This is what I mean. I have several permuted datasets that
I have appended to each other so that the final datafile has 500
permuted sets, each distinguised by a set number i. I would like to
run ASReml for each i value (by i) such that I have 500 different

THere is do DO LOOP statment like FOR I in 1:500
but there are some looping facilities.

There are several solutions possible

Are you happy to create 500 sets of output files?
Do you want to run a script over each set of output to capture what you
want, rather than keeping all the files?

In this context I would keep the data files separate in a folder e.g.

and set up the job as

DATA\SET$1 ...

and run it from a script file with command

ASReml -n job 001
ASReml -n job 002

Well, there are some many variations on the theme.

The disadvantage of stacking all the data in one file is that the whole
file must be read reach time.
But if you do that, then you could use




 SET !D <> $1

Other qualifiers you can consider are !CYCLE

e.g. ASReml -bnr job 00 01 02 03 04 05 06 07 08 09

!CYCLE 1 2 3 4 5 6 7 8 9 0 !JOIN

DATA\SET$1$I.txt ..

would run the jobs in 10 sets of 10 [well maybe than number the data
sets 000 to 499]

So when I did a big simulation, I wrote a program when passed the data
file to ASReml jobs
in this way, and parsed the output. You can do that in R or S or Fortran
or probably perl
and other scripting languages.

I hope this gives some ideas.

Cycling is

May Jesus Christ be gracious to you,

Arthur Gilmour, His servant .

Mixed model regression mapping for QTL detection in experimental crosses.
Computational Statistics and Data Analysis 51:3749-3764 now available at

Personal website:,
Principal Research Scientist (Biometrics)
NSW Department of Primary Industries
Orange Agricultural Institute, Forest Rd, ORANGE, 2800, AUSTRALIA

fax: 02 6391 3899; 02 6391 3922 Australia +61
telephone work: 02 6391 3815; home: 02 6364 3288; mobile: 0438 251 426

ASREML 2 is now available from
The ASReml discussion group is at
To join it,
Archives are at

Proposed travel:
UK 28 Jan
USA 11-15 Feb
Received on Mon Nov 01 2007 - 12:57:10 EST

This webpage is part of the ASReml-l discussion list archives 2004-2010. More information on ASReml can be found at the VSN website. This discussion list is now deprecated - please use the VSN forum for discussion on ASReml. (These online archives were generated using the hypermail package.)