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

Re: writing CLOB to IFS file - CCSID issue



   Thanks Scott, I will try out the copy statement.
   I need to extract the clob because we still have users on the green
   screen (data entry, etc).  The data in the clob is html source code,
   so I wanted to output it to a html file and the user can open the file
   from the green screen to view the html file.  Otherwise, we have the
   clob going to Notes and the Web using a stored procedure for our Notes
   and Web users.
   Since I was using http_tempfile()    to create the IFS file from the
   HTTP API project I figured I should post in the HTTPAPI forum.
   Thanks
   Kara
    
    

   P Please consider the environment before printing this e-mail




   Scott Klement <sk@xxxxxxxxxxxxxxxx>
   Sent by: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   04/21/2009 12:03 PM

                             Please respond to
        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>

                                                                       To

   HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>

                                                                       cc

                                                                  Subject

   Re: writing CLOB to IFS file - CCSID issue

   Hi Kara,
   Your problem, then, is that your IFS file is in EBCDIC.  The PC can't
   read EBCDIC -- it's an ASCII machine.  Unlike IBM i (OS/400), it does
   not understand CCSIDs so can't use them to translate the file for you.
   One solution is to configure NetServer to do the translation for you.
   This is done in iSeries Navigator under "File Systems".  right-click
   the
   share name that you are using, click "Properties" and under "text
   conversion" ask it to translate files with a particular extension.
   Personally, I don't like that solution, because now my Windows apps
   can
   never get the data with it's original binary values... and often times
   that causes headaches for me.  Instead, I'd suggest that you translate
   the file to ASCII in the IFS.
   One easy way to do that is with the CPY CL command.  Copy the data
   with
   DTAFMT(*TEXT) FROMCCSID(*OBJ) TOCCSID(1252) and that should translate
   it
   to ASCII for you.
   A third idea -- which I haven't tried, but if it works, it'd be the
   best
   choice -- would be to pre-create the IFS file as an ASCII file so that
   when the SQL statement loads the data into it, it automatically
   translates it.  This would be a matter of creating the file with the
   open() API and using the O_CCSID option to assign an ASCII CCSID.  As
   I
   said, I haven't tried this yet.
   Finally, my last thought is...  why extract something from a CLOB and
   write it to the IFS to begin with?  Why not have a PC app retrieve teh
   CLOB via JDBC or ODBC (which should translate automatically) and then
   use it from the PC?   Or have a CGI program that retrieves the CLOB
   and
   returns it directly instead of writing it to the IFS?   But these are
   just thoughts...  the way you're doing it should work, provided that
   the
   file is set up properly.
   Also...  I'm missing how this discussion is related to HTTPAPI?  Are
   you
   planning to send the file via HTTP?
   Kara Burkhalter wrote:
   >    My RPG/SQL code is producing the file on the IFS.  If I do wrklnk
   to
   >    that file I can view the html source code that was in the clob.
   If I
   >    try to open the file from the IFS from my pc thru Ops Navigator I
   >    don't get the correct data and it appears to be CCSID problem.
   >    Thanks
   >    Kara
   ----------------------------------------------------------------------
   -
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [1]http://www.scottklement.com/mailman/listinfo/ftpapi
   ----------------------------------------------------------------------
   -
   
   This message may contain confidential or proprietary information and
   is intended only for the person(s) to whom it is addressed. Any use,
   distribution, copying or disclosure of confidential information by any
   other person is strictly prohibited. If you have received this message
   in error, please notify the e-mail sender immediately, and delete the
   original message without making a copy. For information on the UW
   Foundation's privacy policy, please visit:

   [2]UW Foundation Privacy Policy

References

   1. http://www.scottklement.com/mailman/listinfo/ftpapi
   2. http://www.uwfoundation.wisc.edu/home/privacypolicy/privacypolicy.aspx#email
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------