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: 1
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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1038

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: 2639
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 Build two or more rows given some con... DFSORT/ICETOOL 9
No new posts Syncsort- Merging two records into on... SYNCSORT 3
No new posts exclude the 5 first lines for compare... TSO/ISPF 2
No new posts Remove additional information in SUPE... TSO/ISPF 10
This topic is locked: you cannot edit posts or make replies. how to extract a portion (e.g. fields... SYNCSORT 8
Search our Forums:

Back to Top