def secondaryDSs_config(s, filter=True):
    """ returns secondaryDSs string in prun format:
        StreamName:nFilesPerJob:DatasetName[:MatchingPattern[:nSkipFiles]]
        nFilesPerJob is set to zero, so that it is updated later from actual file count.
        MatchingPattern is an OR-separated list of actual file names.
        """
    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,)
        DS = DS.split(':')[-1]
        if filter:
            out.append('%s:0:%s:%s' % (stream, DS, s.files_in_DS(DS, regex=
                True)))
        else:
            out.append('%s:0:%s' % (stream, DS))
    return ','.join(out)
