Posted: Thu Jun 26, 2008 6:43 am Post subject: Extracting part of the record based on condition
I have a file with the record length of 80. The content of the file is as below
Code:
COMMUNICATION ADDRESS COD1 INVALID AAAASDDFF
COMMUNICATION ADDRESS hhhh COD2 INVALID FFSDSDSS
COMMUNICATION ADDRESS hhh COD3 INVALID DFDGGGFG
COMMUNICATION ADDRESS kkk COD1 INVALID SDFDFFG
My requirement is , whenever I hit COD1,COD2 or COD3 in a record then in the output file I need to get like :
The 10 charecters infront of COD1 or COD2 or COD3 and 10 charecters after COD1 or COD2 or COD3 Like below :
Code:
N ADDRESS COD1 INVALID A
RESS hhhh COD2 INVALID F
DRESS hhh COD3 INVALID D
DRESS kkk COD1 INVALID S
Please let me how to do that using any utilities , our shop has a tool called selcopy I am trying out in that as well If not i will be writting a cob program for it.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum