This is described in the SOLUTION COMMAND MANUAL, check the command manual about "loop" and "AUTO time step". To set a total time, you can try this.
BATCH
PARAM
TRANs,BACK
PLOT,DEFOrm
PLOT,FACT,0.7 ! to keep plot in window
DT,,dt
AUTO, TIME, 5, 10, 6
AUTO, DT, 0.0000001, 0.01
LOOP INFInite
LOOP,,10
TIME,, 0.6
LOOP,,5 ! Note that at least 3 iterations
TANG,,1 ! are needed to converge (since no
NEXT ! coupling tangent is included)
PLOT,WIPE
PLOT FRAM 1
PLOT,RANG,0.4,0.9
PLOT,CONT,3 ! Temperature contours
PLOT FRAM 2
PLOT,RANG,-1.0,0.2
PLOT,STRE,1 ! 11-Stress contours
NEXT
FUNC,tinc
NEXT
END
DT = 0.0005