[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EBCDIC to ASCII conversion using CCSID



Scott,
      We are using your examples from the IFSEBOOK and we are having issues converting EBCDIC data to ASCII file to the IFS. It is  similar to the issue Doug B was having.

http://forums.systeminetwork.com/isnetforums/showthread.php?t=46679

 The following are our examples:    

1.   Outfile = open(%Trim(@FileName)                             
           :O_WRONLY + O_CREAT + O_TRUNC + O_CCSID + O_TEXTDATA
           + O_TEXT_CREAT                                      
           :M_RDWR                                             
           :0                                                 
           :819);                                                

   The above example creates the file in EBCDIC and we want the file to be in ASCII. The CCSID tag of the file was 819 and our job 65535 and our job default is 37. This did not work so we tried the following example and it did work:
 
    Outfile = open(%Trim(@FileName)                             
           :O_WRONLY + O_CREAT + O_TRUNC + O_CCSID + O_TEXTDATA
           + O_TEXT_CREAT                                      
           :M_RDWR                                             
           :37                                                 
           :0);  

       This created the file in ASCII, which confused us, as we thought that it would work the other way around. The CCSID tag of this file was 37. 

2. In this example we want the file to be written in EBCDIC not ASCII. When we tried reading the file from the IFS (using O_RDONLY and O_TEXTDATA) it did not translate into EBCDIC.  

 Outfile = open(%Trim(@FileName)                             
        :O_WRONLY + O_CREAT + O_TRUNC + O_CCSID + O_TEXTDATA
        + O_TEXT_CREAT                                      
        :M_RDWR                                             
        :37                                                  
        :0);                                     

So we tried the following and it worked, yet again we were confused, so we would appreciate if you help us understand the reasons for the above.                

Outfile = open(%Trim(@FileName)                             
        :O_WRONLY + O_CREAT + O_TRUNC + O_CCSID + O_TEXTDATA
        + O_TEXT_CREAT                                      
        :M_RDWR                                             
        :0                                                  
        :CP_ISO8859_1);                                     
                                              
Naresh Mistry | TM Architect | Nulogx Inc. | 5090 Explorer Dr, Suite 203, Mississauga, ON L4W 4T9 | T: 905-486-1162 x 238 | F: 905-267-3164 | C: 416-820-5231
www.nulogx.com | Transportation Management Solutions | www.cgfi.ca | Canadian General Freight Index - Register Today


 
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------