IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract 2 more lines below line that matches condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
akashsr_09

New User


Joined: 10 Apr 2021
Posts: 3
Location: India

PostPosted: Sat Apr 10, 2021 6:16 pm
Reply with quote

suppose, Input file has data in the following way.

extradata......
extradata......
extradata......
Limit......255
Associations
FSA.GDG.BASE.APRIL01

extradata......
extradata......
extradata......
Limit......100
Associations
FSA.GDG.BASE.APRIL02

extradata......
extradata......
extradata......
Limit......255
Associations
FSA.GDG.BASE.APRIL03

extradata......
extradata......
extradata......



I want to check if Limit =255, if yes then load that line in an output file along with two more lines below it. Kindly tell how to do it ?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Apr 10, 2021 6:46 pm
Reply with quote

Under no circumstances you can do it while using:
1) JCL
2) VSAM

You CAN do it using the most of other tools in this world except those two mentioned above. For instance:
1) DFSORT or SYNCSORT (or ICETOOL/SYNCTOOL, too)
2) REXX
3) COBOL
4) PL/I
5) FileAid
6) Assembler
. . . hundreds of others . . .

Choose the one you prefer.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Sat Apr 10, 2021 8:31 pm
Reply with quote

Welcome!
Moved to DFOSRT unless you tell us you got SYNCSORT.

You can use IFTHEN=GROUP.. , BEGIN-END conditions ( using the rules you described) to assign IDs to those three set of records and in OUTFILE just INCLUDE IDs NE spaces.

You can search this forum and there are many examples of similar requirements.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
Search our Forums:

Back to Top