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

Re: EBCDIC to ASCII conversion using CCSID



Hi Naresh,

This mailing list is for discussions of FTPAPI and HTTPAPI.  Your 
question doesn't seem to be related to those topics?

I see you've found a similar discussion on System iNetwork's forums. 
That would be a great place to post your message!  Just go to
http://forums.systeminetwork.com, sign-up, and after logging into the 
forum click RPG -> New Thread and post your question.

Thanks!



On 3/25/2011 1:40 PM, Naresh Mistry wrote:
> 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);
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------