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

Can CHANGE command be used without NOMATCH parameter .


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

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Thu Sep 13, 2007 10:04 am
Reply with quote

Hi,

I have an i/p file as follows :

AAAAA111SDF***SDF
BBBBB222SDF***SDG
BBBBB444SDFSGFSDG
BBBBB222SDFSGFSDG
BBBBB555SDF***SDG
AAAAA111DFG***H

Now i want to change 'AAA' from 1st position to 'Y' . So i used CHANGE command. But if the 1st pos has 'BBB' i want to keep it as in i/p , i.e. in o/p it should appear as 'BBB' and wherever it's 'AAA' it should appear as 'Y' . Can anyone tell me if this can be possible with CHANGE syntax . Can a CHANGE syntax be used without NOMATCH parameter. If so then my problem will be solved. Please let me know the syntax also.
Back to top
View user's profile Send private message
ParagChouguley

Active User


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

PostPosted: Thu Sep 13, 2007 6:47 pm
Reply with quote

Hi Ambili S,

Code:

//STEP1   EXEC PGM=SORT                                   
//SORTIN  DD *                                             
AAAAA111SDF***SDF                                         
BBBBB222SDF***SDG                                         
BBBBB444SDFSGFSDG                                         
BBBBB222SDFSGFSDG                                         
BBBBB555SDF***SDG                                         
AAAAA111DFG***H                                           
//SORTOUT DD SYSOUT=*                                     
//SYSOUT  DD SYSOUT=*                                     
//SYSPRINT DD SYSOUT=*                                     
//SYSOUZ  DD SYSOUT=*                                     
//SYSIN   DD *                                             
     OPTION COPY                                       
     OUTREC FIELDS=(1,3,CHANGE=(3,C'AAA',C'Y  '),     
     NOMATCH=(1,3),4,17)                               
/*                                                     


Output:
Code:

Y  AA111SDF***SDF 
BBBBB222SDF***SDG 
BBBBB444SDFSGFSDG 
BBBBB222SDFSGFSDG 
BBBBB555SDF***SDG 
Y  AA111DFG***H   


--Parag
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Sep 13, 2007 7:38 pm
Reply with quote

You can also use INREC OVERLAY for your requirement

Code:

//S1    EXEC  PGM=ICEMAN                                               
//SYSOUT    DD  SYSOUT=*                                               
//SORTIN DD *                                                           
AAAAA111SDF***SDF                                                       
BBBBB222SDF***SDG                                                       
BBBBB444SDFSGFSDG                                                       
BBBBB222SDFSGFSDG                                                       
BBBBB555SDF***SDG                                                       
AAAAA111DFG***H                                                         
/*                                                                     
//SORTOUT DD DSN=OUTPUT.PS.NAME,DISP=(,CATLG,CATLG)       
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  INREC OVERLAY=(1:1,3,CHANGE=(3,C'AAA',C'Y  '),                       
  NOMATCH=(1,3))                                                       
/*                                                                     


Output

Code:

Y  AA111SDF***SDF     
BBBBB222SDF***SDG     
BBBBB444SDFSGFSDG     
BBBBB222SDFSGFSDG     
BBBBB555SDF***SDG     
Y  AA111DFG***H       
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 Sep 13, 2007 9:28 pm
Reply with quote

Or IFTHEN:

Code:

  OPTION COPY                                               
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'AAA'),OVERLAY=(1:C'Y  ')) 
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Fri Sep 14, 2007 9:07 am
Reply with quote

Hi

Thanks for the solutions. It has worked.
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
Search our Forums:

Back to Top