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

Senior Member


Joined: 29 Apr 2008
Posts: 1201

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: 2790
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 Selective extract of multi-record-typ... SYNCSORT 4
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Sort to extract lines DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts Dynamic condition checks COBOL Programming 5
Search our Forums:

Back to Top