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

Need help Field value change


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

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Oct 18, 2007 4:17 pm
Reply with quote

Hi,

I have a file with length 571.
I need to replace the value 10 to 60 in the field 2,3.
The format of the field is S9(03) USAGE COMP-3

Please help me out to solve this.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Oct 18, 2007 4:53 pm
Reply with quote

nagarajan.dharani,

Please check with the following code for your requirement.
Code:
// EXEC PGM=SORT                                   
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE,...
//SYSOUT DD SYSOUT=*                               
 OPTION COPY                                       
 INREC IFTHEN=(WHEN=(2,2,PD,EQ,10),                 
 OVERLAY=(2:2,2,PD,ADD,+50,TO=PD,LENGTH=2))
/*
//
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: Thu Oct 18, 2007 8:59 pm
Reply with quote

nagarajan.dharani,

If you have a 2-byte PD field in positions 2-3 and you want to replace a value of +10 with a value of +60, but leave all other values unchanged, you can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(2,2,PD,EQ,+10),
    OVERLAY=(2:+60,TO=PD,LENGTH=2))
/*


If that's not what you want to do, then please explain more clearly exactly what it is you want to do.
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 Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts SELECT from data change table DB2 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top