View previous topic :: View next topic
|
Author |
Message |
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
I have a dataset which have records that contain either 'X' or 'Y' in the last position(say 420 position).Based on this criteria I have a sort card which separates out 'X' and 'Y' records into two different files.
The sort card looks like:
Code: |
SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(420,1,CH,EQ,C'X')
OUTFIL FILES=2,INCLUDE=(420,1,CH,EQ,C'Y')
END
|
My requirement is that 'X' and 'Y' should not appear in the o/p files.This particular position should be replaced with spaces.
The record length of these two o/p files is 420 and I want to retain that.
Is there any replace command which can be used along with the above SORT card which would replace 'X' and 'Y' characters to spaces? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Bibe,
Quote: |
Is there any replace command which can be used along with the above SORT card which would replace 'X' and 'Y' characters to spaces?
|
Try using OVERLAY command. |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
You can use overlay, see below
Code: |
SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(420,1,CH,EQ,C'X'),
OVERLAY=(420:C' ')
OUTFIL FILES=2,INCLUDE=(420,1,CH,EQ,C'Y'),
OVERLAY=(420:C' ')
|
|
|
Back to top |
|
|
bibek24
New User
Joined: 14 Aug 2007 Posts: 35 Location: Hyderabad
|
|
|
|
Thanks,
Its working |
|
Back to top |
|
|
|