Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Replace a character with 2 characters via sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replace a character with 2 characters via sort card
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: 2158
Location: @my desk

PostPosted: Fri Jan 21, 2011 2:29 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Jan 21, 2011 2:39 pm    Post subject:
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Fri Jan 21, 2011 6:56 pm    Post subject: Reply to: Replace a character with 2 characters via sort car
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Jan 24, 2011 10:03 am    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Mon Jan 24, 2011 10:46 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jan 25, 2011 12:56 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us