def writeInputToTxt(s):
    """ Prepares prun option --writeInputToTxt
        comma-separated list of STREAM:STREAM.files.dat
        """
    out = []
    DSs = s.secondaryDSs()
    for i, DS in enumerate(DSs):
        if DS in s.inds:
            stream = s.inds[DS]
        else:
            stream = 'IN%d' % (i + 1,)
        out.append('%s:%s.files.dat' % (stream, stream))
    out.append('IN:IN.files.dat')
    return ','.join(out)
