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

Replace a character with 2 characters via sort card


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

New User


Joined: 29 Aug 2007
Posts: 19
Location: Chennai

PostPosted: Fri Jan 21, 2011 12:24 pm
Reply with quote

Hi,

Requirement is to replace ß char with SS (Equivalent to German).

Here
>> FINDREP not supported by the system
>> ALTSEQ can't able to replace one char with two chars
>> Also we are not sure where this beta char exist in the input file.

Input:
1 2 3 4 5 6 7 8 9 ===> Approx. position
S T R A ß E <space> 5 <space>

Output:
1 2 3 4 5 6 7 8 9
S T R A S S E <space> 5 <DELETE this space since we have introduced extra char ( we replaced 1 char with 2 chars here) >

So kindly advise the sort card for this requirement.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 21, 2011 2:29 pm
Reply with quote

Bhuvana,

Post your data using Code tags to make it readable and if you do so you wont have to type SPACE to indicate a SPACE. I dint get what you meant by "Approx position" above!!.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 21, 2011 2:39 pm
Reply with quote

Hi,

what is the LRECL and RECFM ?

what happens when the match is the last byte ? where does the second S
go ?

can there be more then 1 match per record ?


Gerry
Back to top
View user's profile Send private message
Bhuvanakp

New User


Joined: 29 Aug 2007
Posts: 19
Location: Chennai

PostPosted: Fri Jan 21, 2011 4:06 pm
Reply with quote

Thanks a lot . Please find the details:

1. LRECL = 1600 / RECFM =FB

2. Also the Beta character comes in first 1000 positions only n Iam sure that it does not come at the end of the record.

3. Beta character occurs many times in a record.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 21, 2011 6:56 pm
Reply with quote

So what happens to the last byte when your data got pushed right by one-byte
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 21, 2011 9:04 pm
Reply with quote

why don't you use the accepted german abbreviation: Str.
for Straße

then you don't have to deal with shifting right and losing data.
Back to top
View user's profile Send private message
Bhuvanakp

New User


Joined: 29 Aug 2007
Posts: 19
Location: Chennai

PostPosted: Mon Jan 24, 2011 9:57 am
Reply with quote

Hi,

Kindly find the details:

1. My file record length is 1600 and Beta char exist only within 1000 positions and it does not exist at the end of the record.

2. The said Straße is an example data only in which ß character exists.

Could anybody please advise the fix for this requirement.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jan 24, 2011 10:03 am
Reply with quote

Hello,

One way would be to write the needed code. . .
Back to top
View user's profile Send private message
Bhuvanakp

New User


Joined: 29 Aug 2007
Posts: 19
Location: Chennai

PostPosted: Mon Jan 24, 2011 10:15 am
Reply with quote

Kindly advice the fix via sort card without FINDREP.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jan 24, 2011 10:46 am
Reply with quote

Hello,

As you have been a member here for more than 3 years, i believe you should already know that you need to provide which release of which sort product is being used. . .

You should also post what you have tried and what was the result.

Depending on how old your sort product, your organization may have to upgrade to something more current. FINDREP has been available for quite some time. If your sort product is far enough out of date, code may be necessary.

The good news is that this would be a trivial bit of code.
Back to top
View user's profile Send private message
Bhuvanakp

New User


Joined: 29 Aug 2007
Posts: 19
Location: Chennai

PostPosted: Mon Jan 24, 2011 2:16 pm
Reply with quote

1. We are using Z/OS DFSORT V1R10.

2. Tried ALTSEQ to replace ß char with Spaces since ALTSEQ not supported.

SORT FIELDS=COPY
ALTSEQ CODE=(5940)
OUTREC FIELDS=(1,1600,TRAN=ALTSEQ)

where 59 - ß and
40 - space

But actually I need to replace ß char with 2 characters -> SS.
So please advise.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 25, 2011 12:56 am
Reply with quote

As you've already realized, the DFSORT function you need is FINDREP. But you've said you don't have FINDREP, so you have two choices:

1) Have your System Programmer install the DFSORT PTF for FINDREP.
This PTF has been available since July, 2008 so it isn't exactly new. The newest DFSORT functional PTF is from Oct, 2010.
2) Don't use DFSORT for this task (that is, write a program).

Everything else here is just "noise".
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 JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts FB to .CSV conversion using sort DFSORT/ICETOOL 7
Search our Forums:

Back to Top