MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replacing multiple occurence

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Mon Apr 23, 2007 2:42 pm    Post subject: Replacing multiple occurence Reply with quote

Hi,

I have question regarding SORT, is there a way of using the CHANGE and NOMATCH command for replacing multiple occurence of the same string.

example

input file has 1574 bytes.

from the position 13 to 1574 anywhere the
string ',.,..,000000.' Can occur,

The above string is a set of 13 characters where in the record other than these strings other fields would be like
',X,YY,NNNNNNN'

string ',.,..,000000.' all these in a record should be changed to spaces.

note '.'(dot) in the example is the nothing but x'00'

would be great if somebody can enlighten me ?
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Apr 24, 2007 1:47 am    Post subject: Reply with quote

Pls do a search before posting. Check teh below link.

http://www.mvsforums.com/helpboards/viewtopic.php?t=8166&highlight=replace
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Apr 24, 2007 2:53 am    Post subject: Reply with quote

and please use the Utilities section
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Tue Apr 24, 2007 8:21 am    Post subject: Sorry for that Reply with quote

Anyway my question is different i think,
my search string can appear anywhere in my input file,

and if it appears i need to change it to spaces that is from position
13 - 1574...

thanks for the help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 24, 2007 9:04 am    Post subject: Reply with quote

ramlak,

Sort products do not have capablity of replacing the string at unknown position. Altseq can be used but it is limited to one to one string comparision. However if you have file-aid then you can use the following control cards
Code:

//SYSIN    DD *                                           
$$DD01 COPY REPLALL=(13,0,X'6B006B00006BF0F0F0F0F0F000', 
  X'40404040404040404040404040'),OUT=0                   
/*
,.,..,000000. in hex is  X'6B006B00006BF0F0F0F0F0F000'


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Tue Apr 24, 2007 10:17 am    Post subject: error Reply with quote

Thanks kolusu thats what i was exactly lookin for .. but when i try running the fileaid it gives me the below error,

Code:
                                                       
$$DD01 COPY REPLALL=(14,0,X'6B006B00006BF0F0F0F0F0F000',
INVALID FUNCTION, NO OUTPUT DATASET PRESENT             
.....SKIPPING TO NEXT $$DD CARD                         

//STEP03   EXEC PGM=FILEAID                             
//SYSOUT   DD  SYSOUT=*                                 
//SYPRINT  DD  SYSOUT=*                                 
//DD01     DD  DSN=xxxx                 
//             DISP=SHR                                 
//         DD  DSN=xxxxx                 
//             DISP=SHR                                 
//DD010    DD  DSN=xxx                 
//             DISP=SHR                                 
//SYSIN    DD  *                                       
$$DD01 COPY REPLALL=(14,0,X'6B006B00006BF0F0F0F0F0F000',
  X'40404040404040404040404040'),OUT=0             
/*                                                     

please advise.
Back to top
View user's profile Send private message
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Tue Apr 24, 2007 10:22 am    Post subject: oops sorry ! Reply with quote

I had a atypo in the outout field name DD010 instead of DD01O

Thanks once again for helping with immediate and response.
Back to top
View user's profile Send private message
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Tue Apr 24, 2007 10:27 am    Post subject: doubt in FILE-AID control card Reply with quote

kolusu,

what does the OUT=0 command means also can you let me
know any good FILEAID manual ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 24, 2007 10:40 am    Post subject: Reply with quote

Quote:

what does the OUT=0 command means also can you let me


The OUT parameter controls the number of records that are written or printed before processing stops. OUT can be used to limit the output, or to extend the amount of printed output past the default of 250 records.

The syntax of the OUT parameter is:
Code:


       OUT=n

n is Number from 0 (zero) to 999999999. Use OUT=0 to process the entire file.


Quote:

know any good FILEAID manual ?


File-aid manuals are copyrighted. If you shop is licensed user then you can request the manuals from

frontline.compuware.com

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramlak
Beginner


Joined: 17 Apr 2007
Posts: 27
Topics: 6

PostPosted: Fri Apr 27, 2007 4:32 pm    Post subject: Reply with quote

Thanks for the info Kolusu, you r simply amazing......
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jul 28, 2008 5:59 pm    Post subject: Reply with quote

Quote:
Sort products do not have capablity of replacing the string at unknown position.


DFSORT now has a find and replace capability with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). The DFSORT control statements for this situation would be:

Code:

    OPTION COPY
    INREC FINDREP=(STARTPOS=13,IN=X'6B006B00006BF0F0F0F0F0F000',
      OUT=13C' ')


For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group