×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Thanks.

So, if this is running in the IBM HTTP server environment, how is the job CCSID set ?  Is there an Apache directive or should I use a CL pgm to set the job ccsid as it executes?   Interactively, I can set the job CCSID.   But for something invoked as a CGI pgm in HTTP server, what is the best approach?

Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
AWS Certified Cloud Practitioner
Microsoft Certified: Azure Fundamentals
Twitter - Sys_i_Geek IBM_i_Geek

On 5/21/2021 6:20 PM, Scott Klement wrote:
Hi Pete,

When I'm stuck using SQL for stuff like that, I do the following... this works fine for me.  The only caveat is you must have your job CCSID set properly.  (It won't work with 65535)

dcl-s request  varchar(2000);

exec sql select json_object(
                  'source' value :fromLang,
                  'target' value :toLang,
                  'text' value json_array(:fromText)
                )
           into :request
           from SYSIBM.SYSDUMMY1;

On 5/21/2021 5:53 PM, Pete Helgren wrote:
Posted to Midrange by habit.....sorry for the duplicate...


I have an sqlrpgle program that creates JSON output using JSON_ARRAY (among others) and outputs JSON (actually, SQL is pretty cool along these lines).  Running just the SQL statement interactively, I get just what I expect, nicely formatted JSON. When I run it within the RPG program, I have some issues.  It really boils down to understanding a couple of things:

If the goal is to output the SQL into a variable and then dump that variable out using Standard Out (QtmhWrStout) what should the variable type be?  Originally I tried varchar but I got an error when it was output due to "reason code 12:   -- The CCSIDs (Coded Character Set Identifiers) of the operands cannot be made compatible."   So either I chose the wrong data type or I need to set a CCSID.  I tripped across a post from a few years ago that using a DBCLOB or a CLOB type an CCSID of 1200.  I do get output now (no error) but it is just a string of '@@@@@@@@@@@@@@@@...'s that tells me a have CCSID issue.

Tried a few other ideas, still get the wrong output.  So the question is:  If the plan is to output through a CGI pgm using QtmhWrStout how should I define the variable and should it be assigned a CCSID?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.