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

To Replace one field with Other


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

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Mon Jun 15, 2009 5:18 pm
Reply with quote

Hi All,

Is it possible to replace one field with other based upon valid condition.
For Example,
F1 F2 F3
01 111 222
02 222 333
01 222 333

I want to replace, F2 field with F3 based upon F1. Suppose, If F1=01, then replace, F2 with F3.

Please reply. I am trying out this with some other. If someone help out with your additional hands, it would be better for me.

Thanks in Advance,
Ashok Kumar.K
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Mon Jun 15, 2009 5:21 pm
Reply with quote

Hi Guys,

Sorry... I missed out the main constraint. I want it to be done in DFSORT not even ICETOOL.

Regards
Ashok Kumar.K
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jun 15, 2009 5:33 pm
Reply with quote

and who is the <smart> guy who put that constraint ??
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Jun 15, 2009 5:56 pm
Reply with quote

Ashok,

Assuming there are spaces between col1, col2 and col3 and your lrecl is 10, the below sort control card would work.

Code:

OPTION COPY
OUTREC IFTHEN=(WHEN=(01,02,CH,EQ,Cā€™01ā€™),
OVERLAY=(04:08,03))


Enrico,
Quote:

and who is the <smart> guy who put that constraint ??


I faced a similar scenario before. When asked, i got the reply that the support guys don't know icetool. icon_confused.gif
I did the requirement with complex sort control card instead of simple icetool and it was gladly accepted. icon_eek.gif
sometimes these kind of requirement really irritate.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jun 15, 2009 6:08 pm
Reply with quote

But ICETOOL is a part of DFSORT, so in effect by using ICETOOL you are using DFSORT.
Back to top
View user's profile Send private message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Mon Jun 15, 2009 7:28 pm
Reply with quote

Thanks a lot senjay. Your code works fine. I thought of handling it in COBOL. But ur 2 line code made my work so easy.

Thanks Again.
Ashok Kumar.K
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top