On Thu, 20 Mar 2008 10:04:11 -0500, McKown, John
<[EMAIL PROTECTED]> wrote:

>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.
>

Write a program that uses ICONV()?    I've used this program (don't 
recall where it came from):

         TITLE 'CONVERT FROM EBCDIC TO ASCII'                
EB2AS    CSECT                                               
*                                                            
         USING *,3                                           
         STM   14,12,12(13)                                  
         LR    3,15                                          
         ST    13,SAVEAREA+4                                 
         LA    12,SAVEAREA                                   
         ST    12,8(0,13)                                    
         LR    13,12                                         
         OPEN  (EFILE,(INPUT),AFILE,(OUTPUT))                
         LH    4,EFILE+82      GET LENGTH OF INPUT RECORD    
READ     EQU   *                                             
         GET   EFILE,WORKAREA                                
         XLATE WORKAREA,(4),TO=A                             
         PUT   AFILE,WORKAREA                                
         B     READ                                          
ENDEFILE CLOSE (EFILE,,AFILE)                                
GOBACK   L     13,SAVEAREA+4                                 
         LM    14,12,12(13)                                  
         LA    15,0                                          
         BR    14                                            
*                                                            
SAVEAREA DC    18F'0'                                        
*                                                            
AFILE    DCB   DDNAME=AFILE,MACRF=PM,DSORG=PS                
*                                                            
EFILE    DCB   DDNAME=EFILE,MACRF=GM,DSORG=PS,EODAD=ENDEFILE 
*                                                            
WORKAREA DS    CL32760                                       
*                                                            
         END   EB2AS                                         

----------------------------------------------------------------------
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

Reply via email to