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

replacing a num/alphanumeric data using OVERLAY


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sumit_mainframe123

New User


Joined: 06 Jul 2010
Posts: 4
Location: pune

PostPosted: Wed Jul 07, 2010 6:34 pm
Reply with quote

Hi all,

I want to replace a existing numeric/alphanumeric data in a file. say replace 44 by 88.
I am using the below code:

SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1,2,ZD,EQ,'44')
OVERLAY=(1:'88'))

but there seems to be some problem with the syntax.
Kindly help me to get the solution.

rgds
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 07, 2010 6:48 pm
Reply with quote

Found and adapted from a simple forum search.
Code:
 SORT FIELDS=COPY                                         
 OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,C'44'),OVERLAY=(1:C'88'))
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jul 07, 2010 10:03 pm
Reply with quote

sumit_mainframe123,

For WHEN:

If you use ZD format, then you must use a decimal constant:

WHEN=(1,2,ZD,EQ,44)

If you want to use a character constant, then you must use CH format:

WHEN=(1,2,CH,EQ,C'44')

You cannot mix the two.

For OVERLAY, you can use a decimal constant or a character constant:

OVERLAY=(1:C'88')

or

OVERLAY=(1:+88,EDIT=(TT))

You can't just make up your own syntax and expect it to work. You have to look up the correct syntax in the DFSORT books which you can access from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
sumit_mainframe123

New User


Joined: 06 Jul 2010
Posts: 4
Location: pune

PostPosted: Thu Jul 08, 2010 10:17 am
Reply with quote

Thanks alot for helping me!!!!

I'll keep the suggestions in my mind.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top