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

Syncsort to replace spaces with CCYYMMDD


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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Fri Jul 10, 2009 4:50 pm
Reply with quote

I have a file with data as below
M**********xxxxxxxx*****************
V*************************xxxxxxxx**

When the first variable is 'M':
I have to check if the xxxxxxxx location is spaces. If it is spaces, I need to replace it with a some hard-coded date.
When the first variable is 'V':
I have to check if the other xxxxxxxx location is spaces. If it is spaces, I need to replace it with a some hard-coded date.

Can this be done using Syncsort?
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Fri Jul 10, 2009 6:16 pm
Reply with quote

Hi kkxlnc,
Use the below code

Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'M',AND,12,10,CH,EQ,C'XXXXXXXXXX'),OVERLAY=(12:C'12/10/2009')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'V,AND,25,10,CH,EQ,C'XXXXXXXXXX'),OVERLAY=(12:C'11/10/2009'))


Here i am assuming that the hard coded date which you are inserting is different in both cases.If the hard coded value is same you can use the second condition along with first codition using OR keyword.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top