YouTube Icon

Interview Questions.

Top 100+ Ibm - Cgidev2 Interview Questions And Answers - May 31, 2020

fluid

Top 100+ Ibm - Cgidev2 Interview Questions And Answers

Question 1. What If My System I Runs With System Value Qccsid 65535?

Answer :

System price QCCSID 65535 inhibits computerized man or woman conversion from a CCSID to any other CCSID. That is general a large trouble with CGI programs.

For instance, the outside HTML of a CGI software isn't translated to the CCSID of the CGI activity when loaded in memory from it. If this HTML carries special characters, these characters are pratically corrupted and while output-ted to the browser they'll motive issues, together with a few piece of Javascript no longer running.

Fortunately, CGIDEV2 service software cares for this hassle. The carrier application exams the process CCSID and, if it's far found to be 65535, it's far changed to its default fee.

However, this will be no longer sufficient. The HTTP server assumes that the CGI is running with the CCSID of device price QCCSID, and this may also purpose problems in individual conversion.

In order to have your HTTP instance jobs going for walks with a CCSID aside from the only specified in gadget cost QCCSID, simply upload the following directive to the configuration document of your HTTP instance:

DefaultFsCCSID nnn

in which nnn is the desired CCSID price.

Question 2. How Can I Start A Page In A New Window?

Answer :

The tag <A> helps the keyword goal which helps you to specify the vacation spot of a web page.

<A HREF="..." target="_blank"> 
starts a web page in a new window

<A HREF="..." target="xxx"> 
starts a web page in an existing window named xxx; if this doesn't exist yet, it's far created.

<A HREF="..." target="_top"> 
starts offevolved a web page in the modern window, after clearing it; that is used when you paintings with frames and also you want to get lower back to the entire window. If you do no longer specify the goal keyword, the page is started out within the contemporary window or frame. 

The key-word target may be also special inside the shape tag. As an instance:

<form method="post" action="/mypath/mypgm.Pgm" target="_blank">

IBM - RPG Interview Questions
Question 3. How Can I Control From My Cgis The Cache Of A Remote Browser?

Answer :

If a web browser (Netscape, MS Internet Explorer, etc.) does use the cache, it is maximum in all likelihood that the following time this browser is asked to name a CGI, it indicates the preceding response in place of issuing a brand new request.

In this kind of case the person could see the cached reaction instead of the brand new one.

Question 4. How Can I Control The Way A Remote Browser Uses Its Cache?

Answer :

You have  methods to keep away from that a browser fetches a preceding version of a page from the cache, in preference to asking a more energizing model of a page to the remote server. 

Technique 1- Avoid to cache a page
Technique 2- Make your reaction a completely unique web page.

IBM - RPG Tutorial
Question five. When Should I Use Method Get, And When Should I Use Method Post In My Cgis?

Answer :

There are two approaches you could invoke a CGI out of your html.

When you use the anchor approach
   <A> ... </A>

you implicitly use the GET approach.

When you use the form method
   <form method=get/post  ... >

you can choose among the GET or the POSTmethod.

Therefore your question makes feel simplest for the shape technique.

Your CGI's, the use of Mel's service program, aren't sensitive to the GET or POST technique, however the far flung browser is.

The GET approach: 

The query string (the string beginning through ? And containing the request parameters) is visible inside the browser command line.

This is useful for testing purposes, because you may effortlessly come across some flaw within the string.

But it's far dangerous when you launch your CGIs, due to the fact the consumer may additionally attempt to alter a few parameters for your request.

The POST technique: There is no manner the user might also see the query string, consequently the question string is more protected against undue manipulations.

Another exciting control mastered through the browser while you use the POST technique, is the safety towards a returned page which isn't within the cache: a conversation box could appear askingwhether you want to re-publish your preceding request. An knowledgeable consumer, who previously submitted an order, might remember the fact that doing this will re-enter the equal order a 2nd time, and would now not move back page. If you used as a substitute the GET technique, no such dialog field could appear for aback web page which is not inside the cache. 

In conclusion my notion is:

-for your forms, use the GET technique to perform the check
-however, earlier than freeing your htmls, substitute the GET with the POST technique.
IBM - AS/four hundred Interview Questions
Question 6. Can You Summarize The Steps I Have To Go Through In Writing My First Cgi?

Answer :

Suppose the following:

your pics (gif's, jpg's, and so forth.) will live in an IFS listing named myobjlib
your source library is known as mysrclib
your item library (the one to contain your dynamic HTML scripts, your CGI packages, and Mel Rothman's carrier program CGISRVPGM) is named myobjlib
your first CGI software is called MYCGI1
Proceed as comply with:

1. Set up your CGI source and object libraries

by means of entering command
CGIDEV2/SETCGILIB SRCLIB(mysrclib) PRDLIB(myobjlib) .

Note 1- Command SETCGILIB - when run from a user profile with *CHANGEauthority at the HTTP configuration file ( QUSRSYS/QATMHTTPC) - will show you a list of the configuration files for the prevailing HTTP instances. If you choose with a "1" a given HTTP instance, the program will add - to the configuration document of that HTTP example - the HTTP directives had to run your CGI packages in library myobjlib.
2. Obtain a sample outside html supply and a sample CGI RPG source by using the use of command

CGIDEV2/CRTCGISRC SRCMBR(mycgi1) SRCLIB(mysrclib) PRDLIB(myobjlib) 

You may additionally bring together the module, create the CGI program and run it. Afterwards you can exchange both the external HTML and the CGI software to fit your needs.

Question 7. How Can I Predict The Performance Of My Cgis?

Answer :

SC41-0607-02 AS/400 Performance Capabilities Reference - Version 4, Release 4 

You should examine Chapter 6, Web serving overall performance

(click on -> to display this guide in PDF format).
(click -> to display this chapter in HTML format).

In this bankruptcy they file a benchmark carried out on a simple non-continual CGI, as an alternative different from those one should develop with our CGI carrier software technique.

IBM - AS/four hundred Tutorial IBM - VSAM Interview Questions
Question 8. How Can I Give More Performance To Some Selected Pages?

Answer :

I received surprising improvements at 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 photograph used inside the welcome page, such as

CacheLocalFile /easy400/ibm_logo.Gif

I additionally brought CacheLocalFile directives for different snap shots often utilized in different pages.

Loading pictures into neighborhood AS/400 cache offers a superbous performance, even better than loading into cache textual content pages.

Question nine. How Can A Cgi Check Whether An Ifs Object Is Available?

Answer :

You may use CGISRVPGM2 subprocedure chkIfsObj2() or subprocedure chkIfsObj3() 

IBM - MVS Interview Questions
Question 10. How To Develop Some Simple Graphs (bar Charts) Using Just Html?

Answer :

What you want is some pattern gif, that you may stretch in step with the value you need 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 could run a sample CGI that displays this kind of graphs,

or you could run an Easy400 application displaying the range of downloaders of the Easy400.Internet CGIDEV2 model.

IBM Cognos Tutorial
Question eleven. Some Special Characters I Key In My Html Source Members Show Different On My Web Pages. Why? How Can I Solve This?

Answer :

The following special characters,

    #  @  ! 
        [  ]  that have unique meanings for HTML and JavaScript, will no longer display efficiently in your Web pages, except you make certain that, before getting into SEU, your task CCSID matches the language of your keyboard.

Do the subsequent:

Step 1- Check out machine fee qccsid.
Step 2- Make certain that your HTML source or stream document includes the perfect characters
Step three- Make certain that your HTML contains the subsequent <meta ... > tag
Step four- Make positive that the HTML out of your CGIs isn't always translated from a CCSID to some other CCSID
IBM Cognos Interview Questions
Question 12. How Can I Automatically Refresh A Web Page?

Answer :

You may additionally use some JavaScript to have a Web web page routinely refreshed after a given number of seconds (milliseconds, to be correct).

Please study approximately the setTimeout technique of object window:

       setTimeout(feature, msec[, arg1[, ..., argN]])

For example, to refresh your web page each 25 seconds, add the following in your web page supply:

<head> 
<script language=JavaScript> 
feature reloadPage()  
        window.Location=window.Area 
 
characteristic refreshPage()  
        setTimeout('reloadPage()',25000)
 
</script> 
</head> 
<body   onLoad=refreshPage()>

IBM - RPG Interview Questions
Question 13. Is There Any Way I Can Ease My Rpg Controls On Numeric Input Fields? How About An Input Date Field?

Answer :

You may upload a few JavaScript to have this performed. Also in this case, however, we endorse your CGI plays the correct exams (a few Web customers disable JavaScript from their browsers).

In your JavaScript assessment you should also keep in mind advantages ("professionals") and drawbacks ("cons").

Seasoned. User errors are more quickly communicated via JavaScript (it runs on the purchaser) than thru CGI reaction. JavaScript makes users greater glad in phrases of quicker prognosis.
Con. Imbedding JavaScript for your HTML might growth the dimensions of your web page, and this could end result to a barely slower reaction, expecially in instances have been the consumer connects through a slow line.
As to examples of JavaScript for controlling input fields, you can observe our page JavaScript examples: everyday expressions. A little in addition you'll discover a hyperlink (Validating shape numeric fields) to a CGI acting thru JavaScript precisely what you're searching out.

Should you be involved, simply down load and install to your AS/400 our library js2.

With regard to the assessments your CGI have to anyhow, here are our tips:

If your CGI did initialize the enter area, on the next "call" it would simply take a look at whether its new value is same to initialized one. If so, the field become now not changed through the user.
You may check numeric statistics via the Mel's provider application chkNbr subprocedure. If you like to apply subprocedure c2n2 as an alternative, please be aware that it ignores slashes however treats dashes as minus symptoms.
Another approach would be to output the date as 3 fields in the shape: month, day, and 12 months with separators as constants among them.
Another approach could be to output the date twice: as soon as in edited form ( modifiable) and as soon as as pure numerics (as an input area).
IBM DB2 Tutorial
Question 14. Netscape 6 Does Not Display Any Images, Gif's Or Jpg's. How Can I Fix This?

Answer :

Do the following:

Go to page PTF Cover Letters
Click for your system's launch
Search for Netscape 6
There is likewise a pass, as a minimum for gif's:

1. Upload the following HTTP directive

       AddType .Gif photograph/gif 8bit

2. Re-start your HTTP server

Question 15. The Output From My Cgi Is Correctly Interpreted By Ms Internet Explorer, Whereas Netscape Navigator Would Display It As A Plain Text. What Should I Do To Have Also Netscape Interpreting The Html Output From My Cgi?

Answer :

A CGI need to always start the HTML reaction in the following way:

Content-kind: text/html 
<html>

The " Content-kind: text/html" line incorporates a so referred to as "HTTP header". This header MUST be followed with the aid of a clean line. See also our page Externally defined HTML.

This header tells the far off browser that the reaction incorporates an HTML script to be interpreted.

While MS Internet Explorer, in absence of one of these header, assumes it by using default, Netscape Navigator assumes a textual content default. Apparently the 2 merchandise did not agree on a widespread method. But this is simply one of the many examples of disagreement.

IBM Informix Interview Questions
Question 16. Is It Possible, In The Same Cgi, To Run More Than One Gethtml Or Gethtmlifs?

Answer :

Yes. There are several methods you may do this.

Using a couple of gethtml or gethtmlifs

However you need to be aware about the subsequent:

Each time a extraordinary external HTML is study, the previous outside HTML is discarded. Therefore sections of a given HTML are now not available whilst a next HTML has been loaded.
CGI performance will no longer be as exact as with one HTML file used again and again.
If you care, we've got an instance of this approach:

Run our example
Display the first external HTML utilized by our example
Display the second one outside HTML used by our example
Display the supply of the CGI used in our instance
Using gethtmlifsmult: This subprocedure permits to load in reminiscence several outside IFS documents containing html code. This subprocedure is fantastically advocated every time numerous CGI's proportion a few HTML code. 

Using Server Side Includes: This permits to merge portions of static HTML code into the HTML output buffer once it has already been sent from the CGI.

Question 17. Is There Any Way To Dynamically Merge Other Html Scripts Into A Given Html?

Answer :

In a sense you're requesting something like a /copy pre-compiler characteristic. This may be extremely useful when you have many html pages sharing some portions of html/javascript. A /copy-like function might permit to hold those common pieces outside, and to encompass them anyplace wished, as a result decreasing both html scripts development time and preservation.

What, as a minimum for my part, might be wished is a few include function to be interpreted / accomplished from the consumer browser at page load time. Unluckily, not anything like this -- as some distance as I recognize -- is available. This approach that any include function must be carried over from the server website.

There are  approaches you can gain this dynamic merging:

using subprocedure gethtmlifsmult to your CGI. This subprocedure permits to load in reminiscence numerous outside IFS documents containing html code. This subprocedure is quite recommended every time several CGI's proportion some HTML code. 
Inclusive of external JavaScript code
the usage of Server Side Includes.
IBM DB2 Interview Questions
Question 18. What Is The Favicon.Ico Request That My Site Receives Now And Then?

Answer :

This request comes from your Internet browser.

When an consumer visiting a page of yours asks the browser to take a favourite (bookmark), the browser attempts to find whether or not your web site presents a favicon.Ico to be related to favorites.

If such icon is found, the browser buddies it to the favorite (bookmark).

For instance, in case you bookmark this page, you will locate that your favourite (bookmark) is associated with our laptop icon.

IBM - AS/400 Interview Questions
Question 19. Under Given Circumstances, My Cgi Should Link To Another Site. How To Implement This?

Answer :

Usually the reaction from your CGI appears as observe:

Content-type: text/html
clean line
<html>
... Etc. ...
</html>

A quite simple manner to have your CGI response linking to any other site is that of supplying just the subsequent reaction:

Location: http://URL
clean line

If you whish, you may run our example and display its assets.

Question 20. How May A Cgi Control Duplicate Inputs?

Answer :

When you've got a CGI (like an Order Entry) receiving enter from a shape, the chance usually exists that the consumer incorrectly sends reproduction inputs.

There are two main cases wherein that is possible.

Case 1: The user enters with the aid of mistake an order line same to the last formerly submitted.

This may be managed in this way:

Have the CGI resending the closing processed data in a hidden enter field of the shape
Have a few javascript to post the shape. This javascript --earlier than filing the form-- would test that the brand new enter information are distinctive from the previous ones.
Case 2: The consumer via mistake presses the Refresh / Reload button of the browser (I.E. Supports additionally F5 for web page reload). In this case, the browser could resend the final transaction. 

One manner a CGI could manage this will be to:

Have the CGI assigning a transaction collection range and storing it in a hidden input subject of the shape
Once the CGI receives the transaction, it may check whether this transaction collection wide variety was already processed. If so, it would forget about the request and issue an errors message. Otherwise, it'd system the transaction and document this transaction sequence variety. This of course calls for a transaction series range document to be available.
IBM AIX Interview Questions
Question 21. Http Default Port 80 Is Used By Some Other Production Http Service. How Can I Create An Http Instance On Another Port To Run Cgidev2 And My Future Cgi Developments?

Answer :

Use command cgidev2/http8000.

It creates a (conventional) HTTP server example for port 8000. The example name is CGIDEV2.

Enter command
strtcpsvr httpsvr(cgidev2)
to begin that instance.
Enter command
wrkhttpcfg cgidev2
to edit its HTTP directives.
Note 1 - To run command CGIDEV2/HTTP8000, you ought to have complete authority on filesQUSRSYS/QATMHINSTC and QUSRSYS/QATMHTTPC.

Note 2 - Command CGIDEV2/HTTP8000 may be run simply as soon as.

Question 22. Is It There An Easy Way To Determine If An Html Section Is Available To Issue A Wrtsection Upon?

Answer :

After analyzing the external html (GetHtml, GetHtmlIfs, or GetHtmlIfsMult you can use the RtvHtmlRcd subprocedure (see member XXXWRKHTML in CGIDEV2/QRPGLESRC). Ask it to retrieve the first report from the section of interest. For example, if 'top' exists and 'xxx' doesn't:

eval rcd = RtvHtmlRcd('pinnacle':1:rc) gives rc = zero 
eval rcd = RtvHtmlRcd('xxx':1:rc) offers rc = -1

If you don't care about the contents or the rcd, you can use callp inst of eval:

callp RtvHtmlRcd('top':1:rc) gives rc = 0 
callp RtvHtmlRcd('xxx':1:rc) offers rc = -1

I might recommending using WrtSection for the segment best if rc = zero. Return codes -1 and -2 are apparent. You can get go back code -3 only if the first parameter is *NONE and the relative file wide variety is within a duplicate section.




CFG