|
View previous topic :: View next topic
|
| Author |
Message |
Sudhanshu Shekhar
New User

Joined: 23 Jul 2008 Posts: 27 Location: City of Joy
|
|
|
|
Hi,
I have a input file that contains two types of records. I want to filter it and write it to two different PS files based on a specific field.
For eg.
My input files reads
| Code: |
123123123123123 R 00000000000001
123123123123123 R 00000000000002
123123123123123 R 00000000000003
123123123123123 A 00000000000001
123123123123123 A 00000000000002
123123123123123 A 00000000000003
123123123123123 A 00000000000004
123123123123123 R 00000000000003
123123123123123 A 00000000000005
|
I want two output files.
File1:
| Code: |
123123123123123 R 00000000000001
123123123123123 R 00000000000002
123123123123123 R 00000000000003
123123123123123 R 00000000000004
|
File2:
| Code: |
123123123123123 A 00000000000001
123123123123123 A 00000000000002
123123123123123 A 00000000000003
123123123123123 A 00000000000004
123123123123123 A 00000000000005
|
I want to write a single sort to do both...  |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
Hello Sudhanshu,
You canuse below sort card
| Code: |
OPTION COPY
OUTFIL INCLUDE=(18,1,CH,EQ,C'R'),FNAMES=OUT1
OUTFIL SAVE,FNAMES=OUT2 |
OUT1 File will contain recrods with R at 18th Byte & OUT2 will contain rest of the records |
|
| Back to top |
|
 |
Sudhanshu Shekhar
New User

Joined: 23 Jul 2008 Posts: 27 Location: City of Joy
|
|
|
|
| Thanks a lot .... it worked fine |
|
| Back to top |
|
 |
|
|