Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to include header and some detail lines but not others

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
AllyDick

New User


Joined: 07 Dec 2019
Posts: 2
Location: Ireland

PostPosted: Sun Dec 08, 2019 10:19 pm    Post subject: How to include header and some detail lines but not others
Reply with quote

Hi,
I have a file that contains content that is similar to below:

HEADERxxxxxxxxxxxAxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
HEADERxxxxxxxxxxxBxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
HEADERxxxxxxxxxxxAxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
HEADERxxxxxxxxxxxBxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa


Header lines have either A or B in column 19.

I want to output to a file that ONLY contains HEADERs with an A in column 19 PLUS any DETAIL lines that are under those header lines.

So output that only includes the items in block:

HEADERxxxxxxxxxxxAxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa

HEADERxxxxxxxxxxxBxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
HEADERxxxxxxxxxxxAxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa

HEADERxxxxxxxxxxxBxxxxxxxxxxxx
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa

The DETAIL lines do not have distinguishing features that can tie them to the HEADER lines.

Anyone any idea how you could do this please?
Back to top
View user's profile Send private message

Joerg.Findeisen

New User


Joined: 15 Aug 2015
Posts: 77
Location: Germany

PostPosted: Mon Dec 09, 2019 6:52 pm    Post subject:
Reply with quote

Code:
//SIMPLE   EXEC PGM=ICEMAN,PARM='MSG=AP'                             
//SORTIN   DD *                                                       
HEADERxxxxxxxxxxxAxxxxxxxxxxxx                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
HEADERxxxxxxxxxxxBxxxxxxxxxxxx                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
HEADERxxxxxxxxxxxAxxxxxxxxxxxx                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
HEADERxxxxxxxxxxxBxxxxxxxxxxxx                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa                                       
/*                                                                   
//SYSOUT   DD SYSOUT=*                                               
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'HEADER'),PUSH=(60:18,1))
  OUTFIL INCLUDE=(60,1,CH,EQ,C'A'),BUILD=(1,59)
  END                                                                 
/*                                                                   


Code:
HEADERxxxxxxxxxxxAxxxxxxxxxxxx   
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa 
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa 
HEADERxxxxxxxxxxxAxxxxxxxxxxxx   
DETAILaaaaaaaaaaaaaaaaaaaaaaaaa 
Back to top
View user's profile Send private message
AllyDick

New User


Joined: 07 Dec 2019
Posts: 2
Location: Ireland

PostPosted: Mon Dec 09, 2019 8:31 pm    Post subject:
Reply with quote

Thank you so much for that response. This is brilliant and worked! Very much appreciated
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Finding a string and concatinating mu... ArunkumarGanesan DFSORT/ICETOOL 11 Thu Jan 09, 2020 5:59 pm
No new posts Include current & next records if... Manny Rizal DFSORT/ICETOOL 22 Mon Dec 30, 2019 9:14 am
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
No new posts Merging lines knobi DFSORT/ICETOOL 4 Mon Nov 04, 2019 10:57 pm
No new posts Header and trailer for a PS file kumara kanthirava JCL & VSAM 5 Mon Aug 19, 2019 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us