Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Repacing data at a fixed position in a dataset with spaces.
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: 1288
Location: Chennai, India

PostPosted: Fri Sep 19, 2008 2:38 pm    Post subject: Reply to: Repacing data at a fixed position in a dataset wit
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us