On Tue, Feb 7, 2017 at 8:44 AM, Ron Thomas <[email protected]> wrote:

> Hi . We have a below file , and here i want to extract all records that
> have a string value "Dropped" , the value is not coming in to any fixed
> position .
> Could some one let me know how to get the records extracted ?
>
>
> 00000003~94800.00~USD~Process~Submitted~~F00000
> 00000004~15640.00~USD~Process~Submitted~~F00000
> 00000005~27200.00~USD~Process~Submitted~~PS0323
> 00000006~2193.00~USD~Process~Submitted~~USHSR1~
> 00178909~750.00~USD~Process~Dropped~Invalid Buyer
>
> Thanks
> Ron T
>
>
​ref:
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.icea100/ice2ca_Relational_condition_format.htm

INCLUDE COND=(1,??,SS,EQ,C'Dropped')

If you like a "weird" solution based on your example, the "awk" language
could be used. You field separator seems to be a tilde, ~, and the value
seems to be in the 5th field. So:

awk -F '~' '$5 == "Dropped" {print;}' <UNIX.input.file

or, if the data is in a z/OS sequential data set:

cp "//'zos.seq.dsn'" /dev/fd/1 | awk -F '~' '$5 == "Dropped" {print;}'​


-- 
Our calculus classes are an integral part of your education.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to