"Please correct me wherever i'm wrong"
I'm Trying to parse an variable record where my records are having "start" keyword or "end" keyword or both.
if my record is having "start" keyword i need the data only after that keyword.
if my record is having "end" keyword i need the data only before that keyword.
if my record is having both "start" and "end" keyword i need the data in between "start" and "end".
if there is none of the keyword is present i want to skip that record.
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,
PARSE=(%01=(STARTAT=C'start',FIXLEN=80))),
IFTHEN=(WHEN=INIT,
PARSE=(%02=(ENDBEFR=c'end',FIXLEN=80)),
BUILD=(%01,%02))
OUTREC IFTHEN=(WHEN=INIT,
PARSE=(%01=(STARTAT=C'start',FIXLEN=80))),
IFTHEN=(WHEN=INIT,
PARSE=(%02=(ENDBEFR=c'end',FIXLEN=80)),
BUILD=(%01,%02))
This is what i tried but am getting all the records.. since i'm using option copy it is giving me all the records(?).. i don't know how to filter first then apply the parse.
edited to align the content to the correction made by the ts