Page 1 of 1

Stripping out EBCDIC chars

PostPosted: Wed Feb 25, 2009 6:13 pm
by jpm4
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

Re: Stripping out EBCDIC chars

PostPosted: Wed Feb 25, 2009 10:13 pm
by swd
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

Re: Stripping out EBCDIC chars

PostPosted: Wed Feb 25, 2009 10:18 pm
by jpm4
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

Re: Stripping out EBCDIC chars

PostPosted: Thu Feb 26, 2009 12:27 am
by Frank Yaeger
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/