Portal | 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: 5
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

Active User


Joined: 15 Aug 2015
Posts: 340
Location: Bamberg, 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: 5
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 Join lines with dfsort kushkush DFSORT/ICETOOL 5 Mon Oct 05, 2020 12:16 pm
No new posts Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts Insert System Runtime in HEADER In SY... Rick Ryan SYNCSORT 9 Tue May 26, 2020 9:01 pm
No new posts using TXT2PDF to colour specific lines jzhardy All Other Mainframe Topics 3 Thu May 14, 2020 9:46 am
No new posts SMF Specify in the INCLUDE parameter ... Antonio A Negrelli DFSORT/ICETOOL 7 Sat Apr 25, 2020 5:32 am

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