View previous topic :: View next topic
|
Author |
Message |
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I would like perform a 'Change All' type function.
The input file (FB 80) contains characters x'6D' that we would like to change to x'40' ANYWHERE in the file.
I could write a Rexx program, but since we are ready using Syncsort on the file to Omit records we do not want, I thought we could try and do the Change there.
I found the CHANGE= subparamneter in the manual, but that appears to want a specific column. This data can be in any column.
We have SYNCSORT FOR Z/OS 1.3.2.1R. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
SyncSort for z/OS 1.3 Programmer’s Guide wrote: |
[c:] p,l,CHANGE=(o,srch1,repl1[,srch2,repl2,...srchn, repln ] ) |
Doesn't the first p,l allows for the entire output record to be specified? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
ALTSEQ or FINDREP can be helpfull, too - I don't have SyncSort manuals handy, so not very sure if FINDREP would work with your version of SyncSort... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I do not know really about syncsort,
if it were dfsort I would have suggested to use the ALTSEQ stuff
something along the lines
Code: |
//SYSIN DD *
SORT FIELDS=COPY
ALTSEQ CODE=(6d40)
OUTREC FIELDS=(1:1,80,TRAN=ALTSEQ)
//*
|
most probably syncsort has something equivalent |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
From how I read it...
Quote: |
The following describes the elements of the CHANGE subparameter:
p,l - The normal SyncSort position-length designation that specifies the search field.
When this search field matches a search constant, the input field will
be changed in the output to a replacement value.
For character or hexadecimal search constants, the search field can be 1 to 64 bytes long. For binary search constants, the search field must be one byte.
%pp - Identifies a fixed-length parsed field that specifies the search field.
When this field matches a search constant, the input field will be changed in the output to a replacement value. |
I understand it to start position and length. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Enrico,
ALTSEQ along with the TRAN=ALTSEQ worked perfectly!
Thanks.... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Enrico- SyncSort also supports ALTSEQ parameter. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Well, my reading is that search field can be any length while the search constant can be as small as one byte.
1,lrecl,CHANGE=(lrecl?,X'6D',X'40')
But for a single byte without replacement length differences, I admit that the ALTSEQ is cleaner....... |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
daveporcelan,
The code provided by enrico will work for your Syncsort version as well. Alternatively you can use the new FINDREP feature supported by SYNCSORT FOR Z/OS 1.3.2.1R. as shown below without worrying about the LRECL.
Code: |
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C'_',OUT=C' ')
//* |
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Arun,
Your example worked perfectly as well.
Thanks...
Note: Our manual which is version 1.3, does not have the FINDREP command in it. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
daveporcelan wrote: |
Note: Our manual which is version 1.3, does not have the FINDREP command in it. |
You're welcome. Do you have the manual for SyncSort 1.3.2? If not, request one from Syncsort Support/Alissa. Even I lost my manual. |
|
Back to top |
|
|
|