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

Change All function in Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Mar 03, 2010 8:43 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 03, 2010 9:18 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 03, 2010 9:31 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 03, 2010 9:34 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Mar 03, 2010 9:35 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Mar 03, 2010 9:41 pm
Reply with quote

Enrico,

ALTSEQ along with the TRAN=ALTSEQ worked perfectly!

Thanks....
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 03, 2010 9:42 pm
Reply with quote

Enrico- SyncSort also supports ALTSEQ parameter.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 03, 2010 9:44 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 03, 2010 9:46 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Mar 03, 2010 9:53 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 03, 2010 9:56 pm
Reply with quote

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. icon_mad.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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
Search our Forums:

Back to Top