Stripping out EBCDIC chars



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Stripping out EBCDIC chars

Postby jpm4 » Wed Feb 25, 2009 6:13 pm

Hi,

Can anyone tell me if there is a relatively straight forward way of stripping out EBCDIC from a mainframe dataset?

The background.....am exporting a varchar field containing a SQL string from a teradata table to a mainframe dataset using BTEQ (report mode). An example of the SQL field would be:

SET FINALSQL = 'CREATE TABLE '
|| MYCURSOR2.DB_NAME || '.'
|| '_'
|| MYCURSOR2.TABLE_NAME_TXT
|| ' AS '
|| MYCURSOR2.DB_NAME || '.' || MYCURSOR2.TABLE_NAME_TXT
|| ' WITH DATA;';

The problem is any new line in the FINALSQL field is written to the dataset as EBCDIC char X'25'. Is there any way to prevent this? (I realise the easiest way would probably be to rewrite the FINALSQL field to elimante the new line, but that will likely result in another set of problems!)

Thanks,
John
jpm4
 
Posts: 3
Joined: Mon Feb 16, 2009 5:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stripping out EBCDIC chars

 

Re: Stripping out EBCDIC chars

Postby swd » Wed Feb 25, 2009 10:13 pm

Hi John - I think I understand your problem. If you can edit your file on the mainframe, could you change the EBCDIC line feed x'25' to a space x'40', so in TSO edit you type

C x'25' x'40' ALL

Would that help you ?

Cheers
Steve
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: Stripping out EBCDIC chars

Postby jpm4 » Wed Feb 25, 2009 10:18 pm

Hey Steve,

Yes that would work - I should have mentioned this will be running in an overnight batch, so what i would be looking for is some way to do that without manually editing the file myself.

Thanks,
John
jpm4
 
Posts: 3
Joined: Mon Feb 16, 2009 5:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stripping out EBCDIC chars

Postby Frank Yaeger » Thu Feb 26, 2009 12:27 am

If you want to change X'25' to X'40' throughout the file, you could use DFSORT's FINDREP function. See the following for details on FINDREP:

http://www.ibm.com/systems/support/stor ... /mvs/ugpf/
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post