more ASCII to EBCDIC conv. 
Author Message
 more ASCII to EBCDIC conv.

I am a PL/1 newbie and working on an MVS platform trying to do an A to E
conversion.  I've attempted to insert the A to E code page into my
declarations that Peter had mentioned in a previous note to Long.  (the
ASCEBC include is not available to me....or should I create it?)  The
compiler read the first couple of lines of the dcl and then gagged.
Does anyone have any sample code that would show some A to E conversion
or any other helpful hints?

Nora



Sun, 05 Jan 2003 03:00:00 GMT  
 more ASCII to EBCDIC conv.


Quote:
> I am a PL/1 newbie and working on an MVS platform trying to do an A
> to E conversion.  I've attempted to insert the A to E code page into
> my declarations that Peter had mentioned in a previous note to Long.
> (the ASCEBC include is not available to me....or should I create it?)

Yes, you should.

Quote:
> The compiler read the first couple of lines of the dcl and then
> gagged. Does anyone have any sample code that would show some A to E
> conversion or any other helpful hints?

> Nora

OK, here my sample. I stored the includes under the names ASC2EBC and
EBC2ASC in my SYSLIB,
The first record of SYSPRINT shows most unprintable characters, in the
secon I find my alphabet again. This program runs on a EBCDIC mainframe,
so the first translation is into ASCII, the second back to EBCDIC.

 I49880: PROC OPTIONS(MAIN);
 /* TRY TO TRANSLATE ASCII TO EBCDIC AND VICE-VERSA */
 DCL (TRANSLATE,PLIDUMP) BUILTIN;
 ON ERROR SNAP BEGIN;
    ON ERROR SNAP SYSTEM;
    CALL PLIDUMP('TFCHB');
 END;
 DCL  SYSPRINT  FILE;
 OPEN FILE(SYSPRINT) PRINT PAGESIZE(132);

 %INCLUDE ASC2EBC;
 %INCLUDE EBC2ASC;

 DCL F1 CHAR(52) INIT
 ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
 DCL F2 CHAR(52) INIT(' ');
 DCL F3 CHAR(52) INIT(' ');

 F2 = TRANSLATE(F1,ASCII,EBCDIC); /* into ASCII, from EBCDIC */
 PUT SKIP LIST(F2);
 F3 = TRANSLATE(F2,EBCDIC,ASCII); /* into EBCDIC, from ASCII */
 PUT SKIP LIST(F3);
 RETURN;
 END I49880;

--
Daniel
------------------------------------------------------------
visit us at:
http://www.winterthur.com

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 06 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. EBCDIC to ASCII conv?

2. Need converter program to translate ascii to ebcdic in mixes ascii/binary file

3. EBCDIC to ASCII

4. ASCII/EBCDIC conversions in Smalltalk

5. Oracle Connect ASCII-EBCDIC Conflict!

6. ASCII to EBCDIC

7. EBCDIC TO ASCII

8. converting EBCDIC to ASCII

9. ASCII & EBCDIC Conversion

10. native rexx ascii to ebcdic translation - a2e.cmd [1/1]

11. native rexx ascii to ebcdic translation

12. Off Topic (special chars in EBCDIC/ASCII)

 

 
Powered by phpBB® Forum Software