The FTP transfer can do the translation for you.
However if you want to translate via a program, something like the
following in Cobol.
01 WS-NUMERIC-FIELDS SYNCHRONIZED.
05 WS-POS PIC S9(9) COMP.
05 WS-POS2 PIC S9(9) COMP.
05 WS-POS3 PIC S9(9) COMP.
05 WS-LEN PIC S9(9) COMP.
05 WS-SIZE PIC S9(9) COMP.
/*****************************************************************
* IN-TEXT and OUT-TEXT only need single character, as calling
* program passes the actual length.
******************************************************************
LINKAGE SECTION.
01 IN-TEXT PIC X.
01 IN-LEN PIC 9(9) COMP.
01 IN-TEXT2 PIC X.
01 IN-LEN2 PIC 9(9) COMP.
01 OUT-TEXT PIC X.
01 OUT-LEN PIC 9(9) COMP.
01 OUT-TEXT2 PIC X.
01 OUT-LEN2 PIC 9(9) COMP.
01 OUT-CHARS PIC S9(9) COMP.
/*****************************************************************
* Convert EBCDIC to ASCII, passes call to TCP/IP service for
* conversion
******************************************************************
1700-CONV-EBCDIC-TO-ASCII.
IF IN-LEN <= 0 AND IN-LEN > 32767
PERFORM 9004-MSG-INV-INPUT THRU 9004-EXIT
ELSE
IF OUT-LEN <= 0 AND OUT-LEN > 32767
PERFORM 9005-MSG-INV-OUTPUT THRU 9005-EXIT
ELSE
IF IN-LEN NOT = OUT-LEN
PERFORM 9007-MSG-MISMATCH-LEN THRU 9007-EXIT
ELSE
MOVE IN-TEXT(1:IN-LEN) TO OUT-TEXT(1:OUT-LEN)
MOVE OUT-LEN TO WS-LEN
CALL 'EZACIC04' USING OUT-TEXT WS-LEN
END-IF
END-IF
END-IF.
1700-EXIT. EXIT.
/*****************************************************************
* Convert ASCII to EBCDIC, passes call to TCP/IP service for
* conversion
******************************************************************
1800-CONV-ASCII-TO-EBCDIC.
IF IN-LEN <= 0 AND IN-LEN > 32767
PERFORM 9004-MSG-INV-INPUT THRU 9004-EXIT
ELSE
IF OUT-LEN <= 0 AND OUT-LEN > 32767
PERFORM 9005-MSG-INV-OUTPUT THRU 9005-EXIT
ELSE
IF IN-LEN NOT = OUT-LEN
PERFORM 9007-MSG-MISMATCH-LEN THRU 9007-EXIT
ELSE
MOVE IN-TEXT(1:IN-LEN) TO OUT-TEXT(1:OUT-LEN)
MOVE OUT-LEN TO WS-LEN
CALL 'EZACIC05' USING OUT-TEXT OUT-LEN
END-IF
END-IF
END-IF.
1800-EXIT. EXIT.
Those 2 subroutines need DSN=SYS1.TCPIP.SEZATCP,DISP=SHR in the linklist
or the syslibs.
Darren
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of McKown, John
Sent: Thursday, March 20, 2008 8:04 AM
To: [email protected]
Subject: Convert EBCDIC to ASCII in batch?
I cannot think of an easy way to do this, so I thought that I'd ask. I
want to copy a sequential file to another sequential file (both on DASD,
not tape!), translating the contents from EBCDIC (CP-037) to ASCII
(ISO8859-1). I can think of a way to do it using UNIX services, but I'm
hoping for a simplier method. The ASCII file is to be transferred to a
Windows system, so each line must end in CRLF.
Yes, I could use Dovetailed Technologies' "fromdsn" and "todsn" piped to
each other, but that seems "silly" to me.
--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology
The information contained in this e-mail message may be privileged
and/or confidential. It is for intended addressee(s) only. If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense. If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html