I want to know a method to skip certain lines in a afile and write a new file. For intasnce I have a file whose initial few line are
000003 2006-09-20 03.24.48
000004 1 AVINASH OPERATIONS --
000005 SHIFTS ALLOWANCE
000006 PAY PERIOD
000007 CAE: INDIA
Now i need to write a new file until i encounter AVINASH. On encountering the word AVINASH , THe rest of the file is written into a new file.
Please let me know if we can do this thru an utility.
NO sequence numbers dont appear in the file.That appeared whn i copied the file..The LRECL is 133 and RECFM=FBA.
My expected output is :
000001 1 AVINASH OPERATIONS --
000002 SHIFTS ALLOWANCE
000003 PAY PERIOD
000004 CAE: INDIA
Actually even in the input file the indentation was centre. What i want in the output file is all the records in the file after AVINASH ..Its basically all records including the line AVINASH. what is getting skipped is the first two empty lines and the DATE.
Please let me know if you have any more clarifications?
Here's a DFSORT job that will do what you asked for. You didn't answer my question "What position does AVINASH start in?" so I assumed it started in position 4. If not, you can change the INCLUDE=(4,... parameter appropriately.
The first step adds a sequence number to each record, finds the record with 'AVINASH' and uses its sequence number (n) to create a DFSORT symbol like this in the SYM data set:
It also copies all of the records with sequence numbers to the T1 data set.
The second step uses the T1 data set (with sequence numbers) as input. It uses the TARGET symbol in the SYM data set in an INCLUDE statement to only keep the records with sequence numbers greater than or equal to the TARGET sequence number.
FNAMES=SYM specifies the output DD name of SYM.
REMOVECC tells DFSORT not to use ANSI carriage control characters in position 1 (these are used for a report). We don't want a carriage control character for the TARGET,+n symbol we create.
NODETAIL tells DFSORT not to write out the detail records. All we want is one header record for the TARGET,+n symbol we create.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: