On 22/07/2023 12:46 am, shivang sharma wrote:
Hi ,

I am not a DFSort expert but we have a requirement to extract datasets
which has storclas (SMF15SCN) = blank.

Not DFSORT, but this is what it looks like in Java using EasySMF:

import java.io.IOException;
import com.blackhillsoftware.smf.SmfRecordReader;
import com.blackhillsoftware.smf.smf15.Smf15Record;

public class NoStorClass
{
    public static void main(String[] args) throws IOException
    {
        try (SmfRecordReader reader = SmfRecordReader
                .fromName("//DD:INPUT")
                .include(15))
        {
            reader.stream()
                .map(record -> Smf15Record.from(record))
                .filter(r15 -> r15.smsClassSections().isEmpty()
                        || r15.smsClassSections().get(0).smf14scn().equals(""))
                .forEach(r15 ->
                {
                    System.out.format("%-24s %-8s %s%n",
                            r15.smfDateTime(),
                            r15.smf14jbn(),
                            r15.smfjfcb1().jfcbdsnm());
                });
        }
    }
}

If you want only new datasets (I suspect you do) you can add another filter step:

.filter(r15 -> r15.smfjfcb1().jfcnew())


--
Andrew Rowley
Black Hill Software

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to