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

Replace option with sort


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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Jan 22, 2009 12:34 pm
Reply with quote

Hi I need to replace some characters with others using sort. For example, I need to replace all "aaaa" with "bbbb" at position 3 to 6 in the file starting from first record to last record wherever it found. My file is varibale length file. I have tried with the following syntax, but getting error

Code:

//SYSIN     DD *                           
  OPTION COPY                             
  OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'SASV'),
                 OVERLAY=(3:C'AMIT'))     
/*           


but I am getting the following error:

Code:

************************************************************
1ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 06:17 ON THU JA
0            OPTION COPY                                                       
             OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'SASV'),                           
                            OVERLAY=(3:C'AMIT'))                               
 ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
 ICE241A 0 *OUTREC  IFTHEN 1 OVERLAY COLUMN OVERLAPS RECORD DESCRIPTOR WORD     
 ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698                   
ICE052I 3 END OF DFSORT


can any please help me

Thanks in advance
Ravi
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 22, 2009 12:55 pm
Reply with quote

kudamala,

From the error messages you posted, it seems like your input file is VB. VB files have a 4 byte RDW field at pos 1-4. If you see 'SASV' at pos 1-4 in browse mode, the actual data pos will be 5-9. You must take care of this while handling VB files.
Back to top
View user's profile Send private message
kudamala

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Jan 22, 2009 4:48 pm
Reply with quote

Arun

Thanks for your suggestion. I have tried with FB records with the following sort card. I am using tape data. It is working without error, but problem is when I check for c0 at displacement 1, it is giving count 210418, but after job execution, in outrec only 75356 replaced with b0, remaining still with c0. Any idia why it is replacing only partical records?

Code:

//SYSIN     DD *                       
  OPTION COPY                           
  OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,X'C0'),
  OVERLAY=(1:X'B0'))             
/*
Back to top
View user's profile Send private message
kudamala

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Jan 22, 2009 5:41 pm
Reply with quote

Here I need to montion one thing, the date is in hex format
Back to top
View user's profile Send private message
kudamala

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Jan 22, 2009 5:42 pm
Reply with quote

sorry Data not Date
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 22, 2009 5:45 pm
Reply with quote

kudamala,

It's not clear what you're trying to do. In your first post you were trying to replace 'SASV' by 'AMIT'. Now you're trying to replace X'C0' by X'B0'. Please explain clearly what exactly you want to achieve. X'C0' will occupy only a single byte. So you should be checking for 1,1,CH,EQ,X'C0'
Back to top
View user's profile Send private message
kudamala

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Jan 22, 2009 6:39 pm
Reply with quote

Arun

Thank you so much for your help. In my first example I was trying for SASV and AMIT that was correct. In my second example I have tried to replace x'c0' with x'b0'. I thought it will occupy 2 bytes. By looking into your answer I have changed the syntax to 1,1,CH,EQ,X'C0'. Now it is working fine.

Once again thank you so much.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 22, 2009 7:42 pm
Reply with quote

Ravi,

You're welcome. icon_smile.gif
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
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 JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top