View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Fri Sep 28, 2007 2:01 am Post subject: Want to extract records based on particular name |
|
|
Hi,
I want to extract the records based on the particular value in the record,
for example i have input file with 100 rec's and in the file there are some records with value VISA in certain field.
I/p file
111111 SIVAKUMAR VISA .....
000000 VISA RAMA ...
333333 MASTER ANJAN
222222 SUMAN BHASKAR VISA
555555 AIZAZ MASTER
Now i want all the records which have value VISA any where in the records
Could anyone help me in this regard
Thanks
Siva |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Fri Sep 28, 2007 3:58 am Post subject: Re: Want to extract records based on particular name |
|
|
sivafdms,
The below code would solve your purpose.
I assumed your input file length as 80.
Code: | //S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
111111 SIVAKUMAR VISA .....
000000 VISA RAMA ...
333333 MASTER ANJAN
222222 SUMAN BHASKAR VISA
555555 AIZAZ MASTER
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'VISA')
/* |
Output file:
Code: | 111111 SIVAKUMAR VISA .....
000000 VISA RAMA ...
222222 SUMAN BHASKAR VISA |
|
|
Back to top |
|
 |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Fri Sep 28, 2007 4:21 am Post subject: |
|
|
Thanks Vkphani
It worked |
|
Back to top |
|
 |
|
|