IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Repacing data at a fixed position in a dataset with spaces.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Fri Sep 19, 2008 2:33 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Sep 19, 2008 2:38 pm
Reply with quote

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
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 19, 2008 2:42 pm
Reply with quote

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
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Fri Sep 19, 2008 4:46 pm
Reply with quote

Thanks,
Its working
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top