YouTube Icon

Interview Questions.

Ibm - Cgidev2 Placement Papers - Ibm - Cgidev2 Interview Questions and Answers - Jul 28, 2022

fluid

Ibm - Cgidev2 Placement Papers - Ibm - Cgidev2 Interview Questions and Answers

Q1. Some Special Characters I Key In My Html Source Members Show Different On My Web Pages. Why? How Can I Solve This?

The following unique characters,

    #  @  ! 

        

Which have special meanings for HTML and JavaScript, will no longer show efficiently in your Web pages, until you ensure that, before entering SEU, your task CCSID suits the language of your keyboard.

Do the following:

Step 1- Check out machine value qccsid.

Step 2- Make positive that your HTML supply or flow report includes the appropriate characters

Step 3- Make sure that your HTML includes the following <meta ... > tag

Step four- Make certain that the HTML from your CGIs isn't trlated from a CCSID to every other CCSID

Q2. How Can I Give More Performance To Some Selected Pages?

I obtained sudden enhancements at the overall performance of my welcome page (/easy400/welcome.Htm), adding the following directives:

CacheLocalMaxBytes 2 M 

CacheLocalMaxFiles 2 hundred 

CacheLocalFile /easy400/welcome.Htm

and adding a CacheLocalFile directive for every photo used within the welcome page, together with

CacheLocalFile /easy400/ibm_logo.Gif

I also delivered CacheLocalFile directives for different pictures regularly utilized in other pages.

Loading photographs into local AS/400 cache offers a superbous overall performance, even better than loading into cache text pages.

Q3. Under Given Circumstances, My Cgi Should Link To Another Site. How To Implement This?

Usually the reaction out of your CGI seems as observe:

Content-type: textual content/html

clean line

<html>

... And so on. ...

</html>

A very simple manner to have your CGI response linking to some other site is that of offering just the subsequent reaction:

Location: http://URL

clean line

If you whish, you can run our example and show its assets.

Q4. How Can I Start A Page In A New Window?

The tag <A> helps the keyword goal which lets you specify the destination of a web page.

<A HREF="..." target="_blank"> 

starts offevolved a page in a brand new window

<A HREF="..." target="xxx"> 

starts offevolved a page in an existing window named xxx; if this does not exist yet, it is created.

<A HREF="..." target="_top"> 

starts a web page in the current window, after clearing it; this is used when you work with frames and you need to get again to the whole window. If you do now not specify the goal keyword, the web page is began in the cutting-edge window or frame. 

The key-word goal may be additionally specific inside the form tag. As an example:

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

Q5. 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 Outpu

A CGI should usually begin the HTML response inside the following manner:

Content-type: textual content/html 

<html>

The " Content-type: textual content/html" line incorporates a so known as "HTTP header". This header MUST be observed with the aid of a clean line. See also our page Externally defined HTML.

This header tells the far off browser that the reaction consists of 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 text default. Apparently the two merchandise did not agree on a fashionable technique. But this is just one of the many examples of confrontation.

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

In a feel you're soliciting for some thing like a /copy pre-compiler characteristic. This could be extraordinarily beneficial when you have many html pages sharing a few portions of html/javascript. A /copy-like function could allow to keep those not unusual portions outside, and to consist of them wherever wished, therefore lowering each html scripts improvement time and renovation.

What, at least in my view, would be wished is some include feature to be interpreted / finished from the client browser at page load time. Unluckily, not anything like this -- as some distance as I recognise -- is available. This me that any consist of characteristic should be carried over from the server web site.

There are  approaches you may attain this dynamic merging:

the usage of subprocedure gethtmlifsmult for your CGI. This subprocedure permits to load in reminiscence numerous outside IFS files containing html code. This subprocedure is distinctly advocated each time numerous CGI's share some HTML code. 

Such as external JavaScript code

the usage of Server Side Includes.

Q7. How Can I Control From My Cgis The Cache Of A Remote Browser?

If an internet browser (Netscape, MS Internet Explorer, and many others.) does use the cache, it is most probable that the next time this browser is asked to name a CGI, it indicates the previous reaction in preference to issuing a new request.

In any such case the consumer might see the cached reaction as opposed to the new one.

Q8. How Can I Automatically Refresh A Web Page?

You may also use a few JavaScript to have a Web web page routinely refreshed after a given wide variety of seconds (milliseconds, to be correct).

Please examine about the setTimeout approach of item window:

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

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

<head> 

<script language=JavaScript> 

function reloadPage()  

        window.Location=window.Location 

 

function refreshPage()  

        setTimeout('reloadPage()',25000)

 

</script> 

</head> 

<body   onLoad=refreshPage()>

Q9. Can You Summarize The Steps I Have To Go Through In Writing My First Cgi?

Suppose the following:

your photographs (gif's, jpg's, and so forth.) will reside in an IFS listing named myobjlib

your source library is named mysrclib

your object library (the only to incorporate your dynamic HTML scripts, your CGI applications, and Mel Rothman's provider program CGISRVPGM) is named myobjlib

your first CGI application is known as MYCGI1

Proceed as comply with:

@Set up your CGI source and object libraries

through coming into command

CGIDEV2/SETCGILIB SRCLIB(mysrclib) PRDLIB(myobjlib) .

Note 1- Command SETCGILIB - when run from a user profile with *CHANGEauthority on the HTTP configuration report ( QUSRSYS/QATMHTTPC) - will display you a listing of the configuration files for the prevailing HTTP instances. If you pick with a "1" a given HTTP instance, the program will upload - to the configuration record of that HTTP instance - the HTTP directives had to run your CGI packages in library myobjlib.

@Obtain a pattern external html supply and a sample CGI RPG supply by the use of command

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

You may also collect the module, create the CGI software and run it. Afterwards you can change both the external HTML and the CGI software to fit you.

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

After studying the outside html (GetHtml, GetHtmlIfs, or GetHtmlIfsMult you could use the RtvHtmlRcd subprocedure (see member XXXWRKHTML in CGIDEV2/QRPGLESRC). Ask it to retrieve the primary file from the section of hobby. For example, if 'top' exists and 'xxx' doesn't:

eval rcd = RtvHtmlRcd('top':1:rc) offers rc = 0 

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

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

callp RtvHtmlRcd('pinnacle':1:rc) gives rc = zero 

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

I could recommending the usage of WrtSection for the section best if rc = @Return codes -1 and -2 are apparent. You can get return code -three handiest if the first parameter is *NONE and the relative record variety is within a replica segment.

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

System cost QCCSID 65535 inhibits computerized character conversion from a CCSID to some other CCSID. That is wellknown a large hassle with CGI programs.

For example, the outside HTML of a CGI application isn't trlated to the CCSID of the CGI job while loaded in reminiscence from it. If this HTML carries special characters, those characters are pratically corrupted and whilst output-ted to the browser they may motive issues, such as a few piece of Javascript now not going for walks.

Fortunately, CGIDEV2 provider software cares for this problem. The provider program checks the activity CCSID and, if it is observed to be 65535, it's miles modified to its default value.

However, this could be no longer enough. The HTTP server assumes that the CGI is going for walks with the CCSID of device fee QCCSID, and this may additionally purpose issues in man or woman conversion.

In order to have your HTTP example jobs running with a CCSID other than the one specified in machine value QCCSID, simply upload the following directive to the configuration file of your HTTP example:

DefaultFsCCSID nnn

wherein nnn is the preferred CCSID cost.

Q12. Is It Possible, In The Same Cgi, To Run More Than One Gethtml Or Gethtmlifs?

Yes. There are several ways you may do that.

Using more than one gethtml or gethtmlifs

However you have to be privy to the following:

Each time a one-of-a-kind outside HTML is study, the previous external HTML is discarded. Therefore sections of a given HTML are not available while a subsequent HTML has been loaded.

CGI performance will now not be as exact as with one HTML report used over and over.

If you care, we have an example of this technique:

Run our example

Display the first external HTML used by our example

Display the second outside HTML used by our instance

Display the supply of the CGI used in our instance

Using gethtmlifsmult: This subprocedure lets in to load in memory numerous outside IFS documents containing html code. This subprocedure is relatively advocated on every occasion several CGI's share some HTML code. 

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

Q13. How Can I Predict The Performance Of My Cgis?

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

You should read Chapter 6, Web serving overall performance

(click on -> to show this guide in PDF format).

(click on -> to show this bankruptcy in HTML format).

In this bankruptcy they file a benchmark completed on a easy non-persistent CGI, as an alternative unique from those one ought to expand with our CGI carrier program method.

Q14. Is There Any Way I Can Ease My Rpg Controls On Numeric Input Fields? How About An Input Date Field?

You might also add a few JavaScript to have this done. Also in this example, but, we advise your CGI plays the proper checks (a few Web users disable JavaScript from their browsers).

In your JavaScript evaluation you should also keep in mind blessings ("pros") and disadvantages ("cons").

Seasoned. User mistakes are more speedy communicated thru JavaScript (it runs on the customer) than via CGI response. JavaScript makes customers greater satisfied in phrases of quicker prognosis.

Con. Imbedding JavaScript on your HTML could growth the scale of your web page, and this could result to a slightly slower reaction, expecially in instances had been the consumer connects via a gradual line.

As to examples of JavaScript for controlling enter fields, you could take a look at our web page JavaScript examples: everyday expressions. A little further you may discover a hyperlink (Validating shape numeric fields) to a CGI appearing thru JavaScript precisely what you're looking for.

Should you be fascinated, just down load and set up in your AS/four hundred our library js2.

With regard to the assessments your CGI must in any case, right here are our guidelines:

If your CGI did initialize the input subject, on the next "name" it might just check whether or not its new value is same to initialized one. If so, the sector became not changed with the aid of the person.

You may take a look at numeric data via the Mel's service software chkNbr subprocedure. If you like to use subprocedure c2n2 alternatively, please word that it ignores slashes but treats dashes as minus signs.

Another method might be to output the date as 3 fields in the form: month, day, and yr with separators as constants between them.

Another technique could be to output the date two times: once in edited form ( modifiable) and as soon as as pure numerics (as an input discipline).

Q15. What Is The Favicon.Ico Request That My Site Receives Now And Then?

This request comes from your Internet browser.

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

If such icon is observed, the browser pals it to the fave (bookmark).

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

Q16. Http Default Port eighty 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?

Use command cgidev2/http8000.

It creates a (conventional) HTTP server example for port eighty@The instance call 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 should have full authority on filesQUSRSYS/QATMHINSTC and QUSRSYS/QATMHTTPC.

Note 2 - Command CGIDEV2/HTTP8000 can be run just once.

Q17. How May A Cgi Control Duplicate Inputs?

When you have got a CGI (like an Order Entry) receiving enter from a form, the chance always exists that the consumer incorrectly sends duplicate inputs.

There are two primary instances where this is viable.

Case 1: The consumer enters through mistake an order line identical to the final previously submitted.

This may be controlled on this manner:

Have the CGI resending the remaining processed statistics in a hidden enter subject of the form

Have a few javascript to post the shape. This javascript --earlier than submitting the form-- could test that the new enter facts are one-of-a-kind from the previous ones.

Case 2: The consumer by way of mistake presses the Refresh / Reload button of the browser (I.E. Helps additionally F5 for web page reload). In this case, the browser might resend the closing traction. 

One way a CGI ought to manipulate this will be to:

Have the CGI assigning a traction sequence wide variety and storing it in a hidden enter subject of the shape

Once the CGI receives the traction, it may test whether this traction series variety become already processed. If so, it might ignore the request and problem an error message. Otherwise, it'd system the traction and report this traction sequence range. This of path calls for a traction series number record to be available.

Q18. How To Develop Some Simple Graphs (bar Charts) Using Just Html?

What you want is a few sample gif, that you could stretch in step with the cost you want to reveal. 

For example, 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 can run a pattern CGI that shows this sort of graphs,

or you may run an Easy400 software displaying the variety of downloaders of the Easy400.Net CGIDEV2 version.

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

You have  approaches to keep away from that a browser fetches a preceding version of a web page from the cache, in place of asking a fresher model of a page to the far flung server. 

Technique 1- Avoid to cache a web page

Technique 2- Make your reaction a unique page.

Q20. When Should I Use Method Get, And When Should I Use Method Post In My Cgis?

There are  methods you can invoke a CGI from your html.

When you operate the anchor method

   <A> ... </A>

you implicitly use the GET approach.

When you use the shape technique

   <form method=get/post  ... >

you could choose between the GET or the POSTmethod.

Therefore your question makes experience handiest for the form approach.

Your CGI's, the use of Mel's provider program, aren't touchy to the GET or POST method, but the far flung browser is.

The GET technique: 

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

This is useful for testing functions, because you could easily locate some flaw inside the string.

But it's miles risky when you release your CGIs, because the user might also attempt to regulate a few parameters to your request.

The POST method: There isn't any manner the user may see the query string, consequently the query string is greater protected against undue manipulations.

Another interesting manipulate mastered by the browser while you use the POST technique, is the safety against a again web page which isn't within the cache: a conversation box might appear askingwhether you need to re-publish your preceding request. An educated consumer, who formerly submitted an order, might remember the fact that doing this would re-enter the same order a second time, and could now not move lower back web page. If you used instead the GET technique, no such conversation box could appear for aback web page which isn't always inside the cache. 

In end my inspiration is:

-to your forms, use the GET method to carry out the take a look at

-but, before releasing your htmls, alternative the GET with the POST approach.

Q21. Netscape 6 Does Not Display Any Images, Gif's Or Jpg's. How Can I Fix This?

Do the following:

Go to web page PTF Cover Letters

Click on your device's release

Search for Netscape 6

There is likewise a pass, at the least for gif's:

@upload the subsequent HTTP directive

       AddType .Gif picture/gif 8bit

@re-begin your HTTP server

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

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




CFG