Page 1 of 1

I want to include records between header and trailer

PostPosted: Wed Jan 29, 2020 5:20 pm
by rakeshsneha1212
Hi All,

Can someone help me with the below requirement?

I have an input file with the below format, I want to keep D1, D2, D3 records if the first 6 bytes of my data has TL03106 and to write it's corresponding H1 & T1 irrespective of what is there in first 6 bytes in H1 & T1 of the file.

TL00973  C   ABCDE00018858                 2020012305150000H1   0000000000000000000000
TL00973  C   ABCDE00018858                 2020012305150000D1ABCD4161290              
TL00973  C   ABCDE00018858                 2020012305150000D212638609500000000100973  
TL00973  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL03106  C   ABCDE00018858                 2020012305150000D1QQQQ8043656              
TL03106  C   ABCDE00018858                 2020012305150000D212638606800000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL00973  C   ABCDE00018858                 2020012305150000D1EEEE3223175              
TL00973  C   ABCDE00018858                 2020012305150000D212638618700000000100973  
TL00973  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL03106  C   ABCDE00018858                 2020012305150000D1MSKU1593605              
TL03106  C   ABCDE00018858                 2020012305150000D212638607800000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL03106  C   ABCDE00018858                 2020012305150000D1PONU8210082              
TL03106  C   ABCDE00018858                 2020012305150000D212638608600000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL03106  C   ABCDE00018858                 2020012305150000D1SUDU8575079              
TL03106  C   ABCDE00018858                 2020012305150000D212638606500000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA
TL03106  C   ABCDE00018858                 2020012305150000D1TCKU6508788              
TL03106  C   ABCDE00018858                 2020012305150000D212638608700000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA0
TL03106  C   ABCDE00018858                 2020012305150000D1TCNU2982303              
TL03106  C   ABCDE00018858                 2020012305150000D212638609200000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA0
TL03106  C   ABCDE00018858                 2020012305150000D1TCNU4581758              
TL03106  C   ABCDE00018858                 2020012305150000D212638614400000000103106  
TL03106  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA0
TL00973  C   ABCDE00018858                 2020012305150000D1TCNU5143083              
TL00973  C   ABCDE00018858                 2020012305150000D212638606300000000103106  
TL00973  C   ABCDE00018858                 2020012305150000D300069808600000000021000EA0
TL00973  C   ABCDE00018858                 2020012305150000T1000000001
 


Regards,
Rakesh MS


topic edited to add the code tags

Re: I want to include records between header and trailer

PostPosted: Wed Jan 29, 2020 6:06 pm
by enrico-sorichetti
we reply on our own time and free of charge

WE EXPECT SOME COURTESY from the people asking for help

when posting data to be used in a sort step USE the CODE tags
makes the data understandable and makes easier to find out the starting end ending columns of the fields

Your post has been edited to use the CODE tags

Re: I want to include records between header and trailer

PostPosted: Wed Jan 29, 2020 8:30 pm
by sergeyken
rakeshsneha1212 wrote:I have an input file with the below format, I want to keep D1, D2, D3 records if the first 6 bytes of my data has TL03106 and to write it's corresponding H1 & T1 irrespective of what is there in first 6 bytes in H1 & T1 of the file.


1) What exactly prevents you from doing this?

2) What did you try so far? Where are the results of your own efforts?

Looks like nothing else is needed but:

1) to get access to mainframe, including TSO/ISPF, and batch processing
2) to read something about SORT utility
3) to try using SORT control statements; only INCLUDE, and SORT must be enough.

Any Example #1 of any SORT guide gives you the template: how to do this.

Re: I want to include records between header and trailer

PostPosted: Wed Jan 29, 2020 8:32 pm
by NicC
TL03106 is 7 bytes not 6. What have you tried? Where are you stuck? What is your expected output from the input that you have shown? What sre the dataset (not 'file') characteristics i.e. LRECL and RECFM?