View previous topic :: View next topic |
Author |
Message |
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Mon Apr 23, 2007 2:42 pm Post subject: Replacing multiple occurence |
|
|
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 |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Apr 24, 2007 2:53 am Post subject: |
|
|
and please use the Utilities section _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Tue Apr 24, 2007 8:21 am Post subject: Sorry for that |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Apr 24, 2007 9:04 am Post subject: |
|
|
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 |
|
|
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Tue Apr 24, 2007 10:17 am Post subject: error |
|
|
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 |
|
|
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Tue Apr 24, 2007 10:22 am Post subject: oops sorry ! |
|
|
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 |
|
|
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Tue Apr 24, 2007 10:27 am Post subject: doubt in FILE-AID control card |
|
|
kolusu,
what does the OUT=0 command means also can you let me
know any good FILEAID manual ? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Apr 24, 2007 10:40 am Post subject: |
|
|
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 |
|
|
ramlak Beginner
Joined: 17 Apr 2007 Posts: 27 Topics: 6
|
Posted: Fri Apr 27, 2007 4:32 pm Post subject: |
|
|
Thanks for the info Kolusu, you r simply amazing...... |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Jul 28, 2008 5:59 pm Post subject: |
|
|
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 |
|
|
|
|