Top IBM Cgidev2 Interview Questions and answers: Here, we highlight some common questions you might be asked during a job interview for IBM related positions. All the best for your interview Preparation.
System value QCCSID 65535 inhibits automatic character conversion from a CCSID to another CCSID. That is general a big problem with CGI programs. For instance, the external HTML of a CGI program is not translated to the CCSID of the CGI job when loaded in memory from it. If this HTML contains special characters, these characters are pratically corrupted and when output-ted to the browser they may cause problems, such as some piece of Javascript no longer running. Fortunately, CGIDEV2 service program cares for this problem. The service program checks the job CCSID and, if it is found to be 65535, it is changed to its default value. However, this may be not enough. The HTTP server assumes that the CGI is running with the CCSID of system value QCCSID, and this can also cause problems in character conversion. In order to have your HTTP instance jobs running with a CCSID other than the one specified in system value QCCSID, just add the following directive to the configuration file of your HTTP instance: DefaultFsCCSID nnn where nnn is the desired CCSID value. The tag <A> supports the keyword target which lets you specify the destination of a page. <A HREF=”…” target=”_blank”> starts a page in a new window <A HREF=”…” target=”xxx”> starts a page in an existing window named xxx; if this doesn’t exist yet, it is created. <A HREF=”…” target=”_top”> starts a page in the current window, after clearing it; this is used when you work with frames and you want to get back to the full window. If you do not specify the target keyword, the page is started in the current window or frame. The keyword target may be also specified in the form tag. As an example: <form method=”post” action=”/mypath/mypgm.pgm” target=”_blank”> If an internet browser (Netscape, MS Internet Explorer, etc.) does use the cache, it is most likely that the next time this browser is requested to call a CGI, it shows the previous response instead of issuing a new request. In such a case the user would see the cached response instead of the new one. SC41-0607-02 AS/400 Performance Capabilities Reference – Version 4, Release 4 You should read Chapter 6, Web serving performance (click -> to display this manual in PDF format). (click -> to display this chapter in HTML format). In this chapter they report a benchmark done on a simple non-persistent CGI, rather different from the ones one could develop with our CGI service program method. I obtained surprising improvements on the performance of my welcome page (/easy400/welcome.htm), adding the following directives: CacheLocalMaxBytes 2 M CacheLocalMaxFiles 200 CacheLocalFile /easy400/welcome.htm and adding a CacheLocalFile directive for each image used in the welcome page, such as CacheLocalFile /easy400/ibm_logo.gif I also added CacheLocalFile directives for other images frequently used in other pages. Loading images into local AS/400 cache provides a superbous performance, even better than loading into cache text pages. You may use CGISRVPGM2 subprocedure chkIfsObj2() or subprocedure chkIfsObj3() What you need is some sample gif, that you may stretch according to the value you want to show. For instance, the following html <table cellspacing=0 cellpadding=0> <tr><td><img src=”/cgidev/blue.gif” alt=”blue line” height=5 width=80></td></tr> <tr><td><img src=”/cgidev/blue.gif” height=5 width=125></td></tr> <tr><td><img src=”/cgidev/blue.gif” height=5 width=300></td></tr> <tr><td><img src=”/cgidev/blue.gif” height=5 width=193></td></tr> </table> If you like, you may run a sample CGI that displays this kind of graphs, or you may run an Easy400 program displaying the number of downloaders of the Easy400.net CGIDEV2 version. The following special characters, # @ ! { } [ ] | which have special meanings for HTML and JavaScript, will not show correctly in your Web pages, unless you make sure that, before entering SEU, your job CCSID matches the language of your keyboard. Do the following: Step 1- Check out system value qccsid. Step 2- Make sure that your HTML source or stream file contains the correct characters Step 3- Make sure that your HTML contains the following <meta … > tag Step 4- Make sure that the HTML from your CGIs is not translated from a CCSID to another CCSID You may use some JavaScript to have a Web page automatically refreshed after a given number of seconds (milliseconds, to be correct). Please read about the setTimeout method of object window: setTimeout(function, msec[, arg1[, …, argN]]) For example, to refresh your page every 25 seconds, add the following to your page source: <head> <script language=JavaScript> function reloadPage() { window.location=window.location } function refreshPage() { setTimeout(‘reloadPage()’,25000) } </script> </head> <body onLoad=refreshPage()> Do the following: There is also a bypass, at least for gif’s: AddType .gif image/gif 8bit Yes. There are several ways you can do this. Using multiple gethtml or gethtmlifs However, you should be aware of the following: If you care, we have an example of this approach: Using gethtmlifsmult: This subprocedure allows to load in memory several external IFS files containing html code. This subprocedure is highly recommended whenever several CGI’s share some HTML code. Using Server Side Includes: This allows to merge pieces of static HTML code into the HTML output buffer once it has already been sent from the CGI. In a sense you are requesting something like a /copy pre-compiler function. This could be extremely useful when you have many html pages sharing some pieces of html/javascript. A /copy-like function would allow to keep these common pieces external, and to include them wherever needed, thus reducing both html scripts development time and maintenance. What, at least in my opinion, would be needed is some include function to be interpreted / executed from the client browser at page load time. Unluckily, nothing like this — as far as I know — is available. This means that any include function must be carried over from the server site. There are two ways you can obtain this dynamic merging: This request comes from your Internet browser. When an user visiting a page of yours asks the browser to take a favorite (bookmark), the browser tries to find whether your site provides a favicon.ico to be associated with favorites. If such icon is found, the browser associates it to the favorite (bookmark). For instance, if you bookmark this page, you’ll find that your favorite (bookmark) is associated with our computer icon. When you have a CGI (like an Order Entry) receiving input from a form, the danger always exists that the user incorrectly sends duplicate inputs. There are two main cases where this is possible. Case 1: The user enters by mistake an order line equal to the last previously submitted. This can be controlled in this way: Case 2: The user by mistake presses the Refresh / Reload button of the browser (I.E. supports also F5 for page reload). In this case, the browser would resend the last transaction. One way a CGI could control this would be to: What if my system i runs with system value QCCSID 65535?
How can i start a page in a new window?
How can I control from my cgis the cache of a remote browser?
How can I predict the performance of my CGIs?
How can I give more performance to some selected pages?
How can a CGI check whether an ifs object is available?
How to develop some simple graphs (bar charts) using just html?
Some special characters i key in my html source members show different on my web pages. why? how can i solve this?
How can I automatically refresh a web page?
Netscape 6 does not display any images, gif's or jpg's. how can I fix this?
Is it possible, in the same cgi, to run more than one gethtml or gethtmlifs?
Is there any way to dynamically merge other html scripts into a given html?
What is the Favicon.ico request that my site receives now and then?
How May a Cgi Control Duplicate Inputs?
Related posts:
- CICS Interview Questions and Answers
- Cognos Interview Questions and Answers
- IBM AIX Interview Questions and Answers
- IBM Assembler Interview Questions and answers
- IBM BPM Interview Questions and Answers
- IBM Cognos TM1 Interview Questions and Answers
- IBM Informix Interview Questions and Answers
- IBM Integration Bus Interview Questions and Answers