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

How to change a particular column value in a file using SORT


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

New User


Joined: 03 Jul 2008
Posts: 5
Location: chennai

PostPosted: Thu Jul 03, 2008 3:23 pm
Reply with quote

Hi
can anybody suggest me how to change a particular column value in a file.
ex: starting position in 10, length 2,alphanumeric.
As the file is huge i am not able to use C ALL 'SS' 'VV' 10.
please suggest me a general sort using OUTREC concept instead of ICETOOL.
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Jul 03, 2008 3:52 pm
Reply with quote

Use this sortcard
Code:

//SYSIN  DD *                             
    OPTION COPY                           
    OUTREC IFTHEN=(WHEN=(10,2,CH,EQ,C'SS'),
           OVERLAY=(10:C'VV'))           
/*                                         
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Thu Jul 03, 2008 4:07 pm
Reply with quote

Hi,

Try ds code !

Code:

//R010     EXEC PGM=SORT                               
//SORTIN   DD  *                                       
123 AAAA SS                                     
222 BBBB X2                                           
444 DDDD SS                                           
/*                                                     
//SORTOUT  DD  SYSOUT=*                               
//SYSIN    DD  *                                       
    SORT FIELDS=COPY                                   
    OUTREC OVERLAY=(10:10,2,CHANGE=(2,C'SS',C'VV'),   
    NOMATCH=(C'OO'))                             
/*                                                     
//SYSOUT   DD  SYSOUT=*                               
//SYSUDUMP DD  SYSOUT=A                               
//*                                                   


Code:

Output
123 AAAA VV   
222 BBBB OO   
444 DDDD VV   
Back to top
View user's profile Send private message
levaku
Warnings : 1

New User


Joined: 03 Jul 2008
Posts: 5
Location: chennai

PostPosted: Fri Jul 04, 2008 11:08 am
Reply with quote

its working!
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jul 04, 2008 11:15 am
Reply with quote

Hi Vaas,

i didn't see anywhere where nomatch was to be changed as well.


Gerry
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Fri Jul 04, 2008 12:02 pm
Reply with quote

gcicchet wrote:
Hi Vaas,

i didn't see anywhere where nomatch was to be changed as well.


Hi Gerry,

Could you plz check "X2" on behalf of "SS" in second Record.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jul 04, 2008 12:26 pm
Reply with quote

Hi,

I maybe missing something but all I can see is a request to change SS to VV in col 10, nothing about X2 to OO


Gerry
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Fri Jul 04, 2008 12:56 pm
Reply with quote

Just for info, I ve given "NOMATCH" condition also !
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top