join two lines
join two lines
(OP)
similar to thread822-1378654: Join 2 lines, but my keyword is on the 2nd line.
Sample Data:
15 EL01-007-CUST-SAVACCT-1 REDEFINES EL01-EVENT-DATA.
20 EL01-007-FR-CUST-SAV1
PIC X(17).
20 EL01-007-TO-CUST-SAV1
PIC X(17).
20 FILLER PIC X(416).
15 EL01-008-CUST-VERID REDEFINES EL01-EVENT-DATA.
20 EL01-008-FR-CUST-VERID
PIC X(15).
20 EL01-008-TO-CUST-VERID
PIC X(15).
20 FILLER PIC X(420).
Problem: If a line starts with PIC, I want to join it to the previous line. However, if the PIC is not first (like the FILLER lines, do nothing. If no PIC in the line, do nothing. This file is 12k lines, so not practical to do manually.
Thanks for the help getting started.
Sample Data:
15 EL01-007-CUST-SAVACCT-1 REDEFINES EL01-EVENT-DATA.
20 EL01-007-FR-CUST-SAV1
PIC X(17).
20 EL01-007-TO-CUST-SAV1
PIC X(17).
20 FILLER PIC X(416).
15 EL01-008-CUST-VERID REDEFINES EL01-EVENT-DATA.
20 EL01-008-FR-CUST-VERID
PIC X(15).
20 EL01-008-TO-CUST-VERID
PIC X(15).
20 FILLER PIC X(420).
Problem: If a line starts with PIC, I want to join it to the previous line. However, if the PIC is not first (like the FILLER lines, do nothing. If no PIC in the line, do nothing. This file is 12k lines, so not practical to do manually.
Thanks for the help getting started.
==================================
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
RE: join two lines
Try this:
CODE
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
RE: join two lines
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?