#sysout
Explore tagged Tumblr posts
spydekkn-blog · 15 days ago
Text
🧠 Day 7 of Java Mastery: Variables Think of variables as labeled boxes that store values your program can use later. In Java, variables help you manage data efficiently and flexibly. 📦 Read Blog: https://wp.me/paNbWh-4J #JavaMastery #JavaVariables #LearnJava #100DaysOfCode #ProgramBasics
0 notes
lurantis-lura · 2 months ago
Text
Tumblr media
Fill in the blank. Something something sysout print during the proposal.
3 notes · View notes
computeringturtle · 4 years ago
Text
aight! I sent the latest thesis chapter to my boss, so drawing time! (After dinner :)) What shall I draw? I kinda wanna continue with my flower or practise some Grogu and/or Din sketches? Suggestions welcome!
0 notes
chamiryokuroi · 6 years ago
Text
Catch me trying to write console.log() in java like a god damn idiot
When you forget how to create a simple ArrayList in Java…………….. “Help”
77 notes · View notes
peeterjoot · 5 years ago
Text
Unexpected COBOL implicit operator distribution!
Unexpected COBOL implicit operator distribution!
Another day, another surprise from COBOL.  I was debugging a failure in a set of COBOL programs, and it seemed that the place things started going wrong was a specific IF check, which basically looked like:
The original code was triple incomprehensible, as it:
Was in German.
Was in COBOL.
Was generated by DELTA and was completely disgusting spaghetti code.  A map of the basic blocks would have…
View On WordPress
0 notes
siva3155 · 6 years ago
Text
300+ TOP JAVA JCL Objective Questions and Answers
Java JCL Multiple Choice Questions :-
1. What is the function of DD DISP parameter? A. Tells the system what to do with the dataset following normal termination of the step B. Describes the status of the dataset C. Tells the system what to do with the dataset following abnormal termination of the step D. All of the above Ans:  D 2. How is the record format of an output dataset specified? A. RECORG parameter B. STORCLAS parameter C. RECFM parameter D. None of the above Ans:  C 3. What is the purpose of DD * statement in JCL? A. Begins an input data prompt at the system console B. Begins an in-stream dataset C. Marks the end of a command stream D. Includes all datasets within a naming pattern Ans:  B 4. A DD statement has 2 types of parameters. Name them? A. Positional, Keyword B. Keyword, Control C. Dynamic, Static D. Named, Dynamic Ans: A 5. What is the function of JOB statement in JCL? A. Marks the end of a job B. Marks the beginning of an instream procedure C. Marks the beginning of a job & assigns a name to the job D. Assigns an execution priority to a job Ans:  C 6. How can a job send a status message to a TSO user at the completion of a job? A. STATUS B. NOTIFY C. ENDMSG D. USER Ans:  B 7. What is the function of a DD statement? A. Identifies & describes a dataset B. Delimits a DO loop C. Marks the start of a declarative section D. Delimits the start of an inline include section Ans:  A 8. When output dataset space is required, what quantity categories are used? A. Primary, Secondary, Directory B. Address, Units, CONTIG or ALS C. Displacement and length D. Megabytes, Kilobytes and Bytes Ans:  A 9. What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step? A. START B. RUN C. EXEC D. GO Ans:  C 10. How can unused space allocation be returned to the system when a dataset is closed? A. RETURN B. RLSE C. CONTIG D. CLOSE Ans:  B
Tumblr media
JAVA JCL Objective Questions 11. Can an individual step be restricted from using all the jobs allowed CPU time? A. Yes B. No C. Only in Catalogued Procedure D. Through the STEPTIME parameter Ans:  A 12. Where can program checkpoints be stored for use in a restart? A. CHCKPOINT DD statement B. SYSCHK DD statement C. CHKOUT DD statement D. CHECK or DD statement Ans:  B 13. How can the disposition of sysout datasets be set for an entire jobstream? A. SYSOUT parameter B. OUTPUT parameter C. DEFAULT parameter D. DEST keyword Ans:  A 14. What statement marks the end of an in-stream or Catalogued procedure? A. STREAM B. SET C. PROC D. PEND Ans:  D 15. What is the function of DD name parameter with a 2 part structure; Audit.Report? A. Override the Audit DD statement in the report B. Override the Report DD statement in the Audit procedure C. Concatenate a dataset onto a DD statement in a called module D. Delete the Audit DD statement in the Report Ans:  B 16. Which DD parameters are required? A. All parameters & Keywords are optional B. Dsname, SPACE, RECFM C. Dsname, SPACE, UNIT D. Dsname, DISP, SPACE Ans:  A 17. How can an in-stream dataset be terminated? A. // B. //* C. /* D. None of the above Ans:  C 18. What is the function of the DD DCB keyword? A. Begins the subparameters of the DCB B. Begins the DASD control block C. Marks the close of the DCB D. Modifies the record type parameters Ans:  A 19. What is the maximum length of a single line of JCL? A. 71 bytes B. 60 bytes C. 55 bytes D. 80 bytes Ans:  A 20. What is the purpose of DD DUMMY statement? A. Marks a deleted DD statement B. Begins an interpreted command stream C. Specifies no space allocation & no disposition processing D. Suppress command processing Ans:  C 21. Many JCL statements contain specific values designed to direct and control the execution of the statement. What are these fields called? A. Linkage Variables B. Parameters C. Control Libraries D. Includes Ans:  B 22. When space is allocated for an output dataset, what units can be used? A. Disks B. Megabytes C. Cylinders, Tracks, Blocks D. Bytes Ans:  C 23. What is the format of comment statement? A. // B. //* C. /* D. None of the above Ans:  B 24. A DD statement consists of 4 fields. Name them? A. Name, DD, Space, Device B. Format, Name, DD, Space C. DD, parameter, device, format D. Name, DD, parameter, comments Ans:  D 25. What DD statement is used to supply the name of a dataset? A. Name B. Dsname C. Label D. File Ans:  B 26. What is the purpose of the DD KEYLEN parameter? A. Specify the length of a data set key in bytes B. Override the key length of an SMS defined VSAM dataset C. Override the key length specified in the dataset label D. All of the above Ans:  D 27. What is the function of the STEPLIB DD statement? A. Identify a library to be searched for programs named in the EXEC statement B. Identify a library containing executable job steps C. Override the system step library within a job stream D. All of the above Ans:  D 28. How can return codes be tested before execution of a job step? A. Through the RC keyword B. Through the CODE keyword C. Through the COND keyword D. Through the RETURNCD keyword Ans:  C 29. What is concatenating? A. Overriding or adding procedures B. Logically connecting input datasets C. Overriding a called PROC dsname D. All of the above Ans:  B 30. How can values be passed from the job stream to an executable program? A. Through the PARM keyword B. Through the VALUE parameter C. Through the PGM parameter D. All of the above Ans:  A 31. Must tape dataset definitions include VOL=SER specifications? A. Yes B. No C. Only for uncataloged datasets D. Only for cataloged datasets Ans:  C 32. What is the function of //JCLLIB statement? A. Identifies the source of the JCL commands B. Points to the system software library C. Marks the beginning of the in-stream JCL D. Identifies the libraries that the system will search for include groups or procedures named in EXEC statements Ans:  D 33. What parameter of the job statement is used to limit the CPU time consumed by the job? A. RUNTIME B. TIME C. LIMIT D. EXECMAX Ans:  B 34. What statement marks the beginning of an in-stream or cataloged procedure in JCL and assigns default values to parameters defined in the procedure? A. STREAM B. SET C. PROC D. PEND Ans:  C 35. How can a stopped job be started again? A. Through the RETURN parameter B. Through the STARTUP parameter C. Through the RESTART parameter D. Through the CHECKPNT keyword Ans:  C 36. In order to continue a job after a return code of 12 in step1, what the step2 EXEC statement include? A. CONTINUE B. COND = (12,NE) C. COND = (12,GE) D. COND = (12,EQ) Ans:  B 37. In SMS datasets, what is the function of the DD MGMTCLAS keyword? A. Specify a management class for a new dataset B. Lookup a storage profile from the class library C. Begin a storage class definition block D. Alters the default storage profile for the dataset Ans:  A 38. How can the submitting users RACF authority be overridden in a job stream? A. Through the USER parameter B. Through the USER and PASSWORD parameter C. By notifying the console operation to override the authority D. Through the RACF parameter Ans:  B 39. What parameters can be used to limit the number of records written to a SYSOUT dataset? A. LIMIT B. OUTLIM C. SIZE D. MAX Ans:  B 40. What statement can be used to send data to another MVS JES3 node? A. LINK B. CONNECT C. XMIT D. SEND Ans:  C JAVA JCL Questions and Answers pdf Download Read the full article
0 notes
nobalg · 8 years ago
Text
You can but shouldn’t #Java #static
Tumblr media
In any country, if you are driving a bike or a car, then there are rules which you must follow. These rules are nothing but conventions which ensures each traveler’s safety. If everybody follows them , no accidents happen. A slight ignorance can lead to disastrous accidents. You can take your car over a footpath, can jump traffic lights but as the title says, you should not. At times you may get away with these stuff but still by not following the conventions and rules you are putting yourself as well as others in danger.
I write a blog post every time I find something interesting or worth sharing. In case of static methods in java, there is stuff which is allowed and no one is gonna stop you from doing , but by convention we must avoid those scenarios. Before introducing the ambiguous scenario 
lets understand static first.
Understanding static in Java quickly
static members belong to the class instead of a specific instance.
It means that only one instance of a static field exists, even if you create a million instances of the class or you don't create any. It will be shared by all instances.
Since static methods also do not belong to a specific instance, they can't refer to instance members (how would you know which instance Hello class you want to refer to?). static members can only refer to static members. Instance members can, of course access static members.
static members can access instance members through an object reference.
SCENARIO
Lets say you have a class ,
Tumblr media
Now you know that static methods don’t need an instance of a class to make a call and can be called directly from class name as follows.
Tumblr media
and also, static methods of the class can be accessed by the reference of the class too.So following code is valid too.
Tumblr media
Whats strange is the following piece of code, it will compile as well as execute successfully, The sysout of the method body will be printed in the console.
Tumblr media
How come? The object reference was null and the method was called on a null reference . It should throw NullPointerException. But the program executed successfully.Why?
Now, Repeat with me, 
“When accessing a static member through an object reference expression, only the declared type of the reference matters. It doesn't matter if the reference is actually null, since no instance is required“ .
If you would have called a non-static method on a null object reference, you would be getting the Null Pointer Exception, but not in this case. It was because your method was static.
youtube
You shouldn’t ever try to call static methods on object references rather they should be called on the class names only, as they belong to the class, not to the instances of the class.
Why should you avoid ?
Because  it gives a very misleading appearance on what it's actually doing. For instance think of it as you are reading someone’s code to make a fix or feature addition. You came across something like this.
Tumblr media
while adding your feature, you will be thinking that the ‘object’ reference is not null, and hence you can add other method calls below this piece of code. Hence you added a call to your own newly created non-static method below this code like following
Tumblr media
what if the someMethod was a static method and object reference is null. Your code will fail in that case.
Hope you understood the topic. Thanks for your time.
2 notes · View notes
weird-java-blog · 8 years ago
Text
Schrodinger's variable
What do you think this snippet of code prints?
public static void main(String[] args) {         System.out.println(test()); } public static int test(){         int i = 0;         try{                 i = 2;                 return i;         } finally{                 i = 12;                 System.out.println("finally block " + i);         } }
Code prints:
finally block 12 2
So, according to sysout, firstly i = 2, then finally block executes, assigns i = 12, prints “finally block 12″ and then try block returns i = 2. Actually, finally won't update the value begin returned to the caller, because that value has already being placed in another part of memory. Let’s try to use return in finally block:
public static void main(String[] args) {      System.out.println(test()); } public static int test(){       int i = 0;       try{              i = 2;              return i;       } finally{              System.out.println("finally block " + i);              return 12;       } }
Code prints:
finally block 2 12
Here return actually changes return value. although it’s very bad style.
1 note · View note
zdevops · 5 years ago
Text
Let’s Encrypt CA into RACF
So, you want to add the Let’s Encrypt CA into RACF so you can call services via HTTPS that use the (awesome and free) Let’s Encrypt Certificates?
Here’s how I’ve done it ...
First, download the Let’s Encrypt Authority X3 certificate via https://letsencrypt.org/certificates/
It’s a basic ‘text-file’ that should look something similar to the following:
-----BEGIN CERTIFICATE----- MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/ KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg== -----END CERTIFICATE-----
Now alloate a dataset in z/OS that's 80 bytes wide and has a RECFM of VB. Then stick the contents of that downloaded certificate into that dataset (ZDO.LETSENC.CA.VB in this example) as a datasetname.
Our trusty IKJEFT01 is well equipped to exeute RACF commands 'via JCL', so let's whip up some JCL to import this certificate into RACF.
//IMPORT EXEC PGM=IKJEFT01 //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSTSIN DD * RACDCERT + ADD('ZDO.LETSENC.CA.VB') + CERTAUTH + HIGHTRUST + WITHLABEL('Lets Encrypt CA') SETROPTS RACLIST(DIGTCERT) REFRESH
After submitting that, the Let's Encrypt CA is available on your system. You can verify this via the RACDCERT LIST CERTAUTH TSO command.
You'll see the following information:
Label: Lets Encrypt CA Certificate ID: 2QiJmZmDhZmjgdOFo6JAxZWDmaiXo0DDwUBA Status: HIGHTRUST Start Date: 2016/03/17 12:40:46 End Date: 2021/03/17 12:40:46 Serial Number: >0A0141420000015385736A0B85ECA708< Issuer's Name: >CN=DST Root CA X3.O=Digital Signature Trust Co.< Subject's Name: >CN=Let's Encrypt Authority X3.O=Let's Encrypt.C=US< Signing Algorithm: sha256RSA Key Usage: HANDSHAKE, CERTSIGN Key Type: RSA Key Size: 2048 Private Key: NO Ring Associations: *** No rings associated ***
Easy as pie....
0 notes
rynex4 · 8 years ago
Text
[Java]例外はパイプでキャッチ可能
try {   sysout(”Nothing here.”); } catch( Exception | IOException | NumberFormatException ex) {   sysout(”F**K OFF!”); }
0 notes
peeterjoot · 5 years ago
Text
Computing "offsetof" in COBOL
Computing “offsetof” in COBOL
I couldn’t find a way to compute something like C offsetof in COBOL code.  What I could manage to figure out how to do is compare addresses of a runtime instantiation of the structure, effectively doing this indirectly.  Here’s the ugly mess that I cooked up:
I couldn’t figure out the right syntax to do a single compute statement that was just the difference of addresses, as I got…
View On WordPress
0 notes
hahavagina · 13 years ago
Audio
stbb268 one for the ladies - beatfux aka sysout
apparently the music is listen to is just sounds, i'm okay with that. i like good sounds. lol
5 notes · View notes
aqdenostre · 13 years ago
Video
youtube
„Mund verbieten, kann man ihnen nicht – den Maschinen“
0 notes
siva3155 · 6 years ago
Text
300+ TOP COBOL Interview Questions and Answers
COBOL Interview Questions for freshers experienced :-
1. What is COBOL? COBOL is abbreviated as Common Business Oriented Language and it is one of the oldest programming languages. It primarily used for business, finance and administrative systems for companies. 2. What is the use of EVALUATE statement? Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no ‘break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made. 3. How do you come out of an EVALUATE statement? After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code. 4. What is a scope terminator Give example? Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF. 5. When would you use in-line perform? When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate Para and use PERFORM Para name rather than in-line perform. 6. What the difference is between CONTINUE and NEXT SENTENCE ? They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 0 then next sentence end if display ‘line 1' display ‘line 2'. display ‘line 3'. Note- there is a dot (.) only at the end of the line. 7. How many bytes does a S9(7) COMP-3 field occupy? It will take 4 bytes. Sign is stored as hex value in the last nibble. General formula is INT((n2) + 1)), where n=7 in this example. 8. What is Static and Dynamic linking? In static linking, the called subroutine is link-edited into the calling program, while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state. 9. What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY) (applicable to only MVSESA Enterprise Server) ? These are compile link edit options. AMODE stands for Addressing mode and RMODE for Residency mode. AMODE(24) - 24 bit addressing; AMODE(31) - 31 bit addressing AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31-bit programs that call 24-bit programs. (OSVS Cobol pgms use 24-bit addresses only). RMODE(ANY) - Can reside above or below 16 Meg line. 10. What is SSRANGE, NOSSRANGE? These are compiler options with respect to subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.
Tumblr media
COBOL Interview Questions 11. How do you set a return code to the JCL from a COBOL program? Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program. 12. How can you submit a job from COBOL programs? Write JCL cards to a dataset with xxxxxxx SYSOUT= (A, INTRDR) where ‘A' is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file. 13. What are the differences between OS VS COBOL and VS COBOL II? OSVS Cobol pgms can only run in 24-bit addressing mode, VS COBOL II pgms can run either in 24 bit or 31-bit addressing modes. Report writer is supported only in OSVS Cobol. USAGE IS POINTER is supported only in VS COBOL II. Reference modification e.g. WS-VAR(12) is supported only in VS COBOL II. EVALUATE is supported only in VS COBOL II. Scope terminators are supported only in VS COBOL II. OSVS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds. Under CICS Calls between VS COBOL II programs are supported 14. What are the steps you go through while creating a COBOL program executable? DB2 precompiled (if embedded SQL used), CICS translator (if CICS pgm), COBOL compiler, Link editor. If DB2 program, create plan by binding the DBRMs. 15. Can you call an OS VS COBOL pgm from a VS COBOL II pgm ? In non-CICS environment, it is possible. In CICS, this is not possible. 16. What is an in line PERFORM When would you use it anything else to say about it? The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line, PERFORM's work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs. 17. What COBOL construct is the COBOL II EVALUATE meant to replace? EVALUATE can be used in place of the nested IF THEN ELSE statements. 18. Explain how to differentiate call by context by comparing it to other calls? The parameters passed in a call by context are protected from modification by the called program. In a normal call, they can be modified. 19. Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax's 1) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 20. What is the difference between comp and comp-3 usage Explain other COBOL usages? Comp is a binary usage, while comp-3 indicates packed decimal. The other common usage's are binary and display. Display is the default. 21. What is the default value(s) for an INITIALIZE? What keyword will allow for an override of the default? INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults. 22. What is the difference between a binary search and a sequential search what are the pertinent COBOL? In a binary search, the table element key values must be in ascending or descending sequence. The table is ‘halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search, the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. 23. Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space? Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes. 24. How do you differentiate between COBOL and COBOL-II? The following features are available with VS COBOL II MVSXA and MVSESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. VMXA and VMESA support the compiler and the object programs it produces can be run in either24- or 31-bit addressing mode. VSEESA supports the compiler and the object programs it produces can be run under VSEESA. 25. What is PERFORM what is VARYING? The PERFORM statement is a PROCEDURE DIVISION statement which transfers control to one or more specified procedures and controls as specified the number of times the procedures are executed. After execution of the specified procedures is completed (i.e., for the appropriate number of times or until some specified condition is met), control is transferred to the next executable statement following the PERFORM statement. There are 5 types of PERFORM statements Basic PERFORM PERFORM TIMES PERFORM UNTIL PERFORM VARYING IN-LINE PERFORM 26. What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL? Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. 27. Why do we code s9 (4) comp In spite of knowing comp-3 will occupy less space? Here s9(4)comp is small integer, so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes. 28. What are the different forms of EVALUATE statement? EVALUATE SQLCODE ALSO FILE-STATUS WHEN A=B AND C=D WHEN 100 ALSO ‘00' imperative stmt imperative stmt WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32' imperative stmt imperative stmt WHEN OTHER WHEN OTHER imperative stmt imperative stmt END-EVALUATE END-EVALUATE EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE WHEN 100 ALSO TRUE WHEN 100 ALSO A=B imperative stmt imperative stmt WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4) imperative stmt imperative stmt 29. Is it possible that the REDEFINES clause has different picture clauses compared to the one it redefined? Yes, we can have different PIC clauses. E.g.: 05 REGULAR-EMPLOYEES 10 LOCATION PICTURE A(8) 10 GRADE PICTURE X(4) 10 SEMI-MONTHLY-PAY PICTURE 9999V99 10 WEEKLY-PAY REDEFINES SEMI-MONTHLY-PAY PICTURE 999V999 05 TEMPORARY-EMPLOYEE REDEFINES REGULAR-EMPLOYEE 10 LOCATION PICTURE A(8) 10 FILLER PICTURE X(6) 10 HOURLY-PAY PICTURE 99V99 30. How you can read the file from bottom? The question is very general. Let us look into these possibilities: QSAM (sequential) file: You can run it thru SORT utility adding SEQNUM and then sort then sort by SEQNUM in DESC order VSAM: In CICS, you can read backward using READREV; VSAM: I Batch, unload the VSAM file using SORT in DESC order by key value 31. If you are current on the owner of a set, what is the difference between obtain next and obtain first? There is no, difference. There is a difference between obtain first and obtain next for an area sweep, but not when current on the owner in a set. 32. What is a bind? Binding is a process that creates the access path logic for the sql statements within a COBOL program. After precompilation of a COBOL program a dbrm (has all the embedded sql statements) is created. This dbrm is then bound to form a plan (executable form of the sql statements). 33. Why would you use find and get rather than to obtain? Find tells you whether the record is actually in the database. If it is not found you save the overhead to obtain. 34. What is an area sweep and when is it used? An area sweep accesses records based on the physical location in a database area. It can be total, meaning a record-by-record search of the area, or it can be of occurrences of records of a specific type. 35. What does a status return code of nn29 mean in relation to record locks? nn29 means that two run units are waiting to set locks on the same record and are in deadlock. 36. How are record locks released? Locks are released by a change in currency or by a commit, rollback, or finish command. 37. What are the types of record locks and how are they set? Locks may be shared or exclusive. Shared means that other run units can retrieve the record but cannot modify it. Exclusive means that other run units can neither retrieve nor modify it. Record locks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command. 38. Name the divisions, which are available in a COBOL program? IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION. 39. What are the different data types available in COBOL? The different data types available in COBOL are Alphanumeric (X), alphabetic (A) and numeric (9). 40. What does the INITIALIZE verb do? Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER OCCURS DEPENDING ON items left untouched. 41. What are 77 levels used for? It is used in Elementary level item. It cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves. 42. What does the IS NUMERIC clause establish? IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. “IS NUMERIC” return TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and -. 43 How do you define a table/array in COBOL? ARRAYS. 05 ARRAY1 PIC X(9) OCCURS 10 TIMES. 05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX. 44. What is the difference between index and subscript? Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET. Need to have index for a table in order to use SEARCH, SEARCH ALL. 45. What is the difference between SEARCH and SEARCH ALL? SEARCH - is a serial search. SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL. 46. What should be the sorting order for SEARCH ALL? It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order). 47. What is binary search? Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies. 48. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not ABEND. What is wrong with it? Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE. 49. How do you sort in a COBOL program Give sort file definition, sort statement syntax and meaning? Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY…. USING file-2 GIVING file-3. USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING It can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2. file-1 is the sort (work) file and must be described using SD entry in FILE SECTION. file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-3 is the out file from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-1, file-2 & file-3 should not be opened explicitly. INPUT PROCEDURE is executed before the sort and records must be released to the sort work file from the input procedure. OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be returned one at a time to the output procedure. 50. How do you define a sort file in JCL that runs the COBOL program? Use the SORTWK01, SORTWK02… dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required. 51 What is the difference between performing a SECTION and a PARAGRAPH? Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. Performing a PARAGRAPH will cause only that paragraph to be performed. 52 What the difference is between CONTINUE and NEXT SENTENCE? They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 > 0 then next sentence end if display ‘line 1' display ‘line 2' display ‘line 3'. *** Note- there is a dot (.) only at the end of the last 2 statements, see the effect by replacing Next Sentence with Continue *** 53 What does EXIT do? Does nothing! If used, must be the only sentence within a paragraph. 54 Can I redefine an X(100) field with a field of X(200)? Yes. Redefines just causes both fields to start at the same location. For example: 01 WS-TOP PIC X(1) 01 WS-TOP-RED REDEFINES WS-TOP PIC X(2). If you MOVE ‘12' to WS-TOP-RED, DISPLAY WS-TOP will show 1 while DISPLAY WS-TOP-RED will show 12. 55 What do you do to resolve SOC-7 error? Basically you need to correct the offending data. Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Many installations provide you a dump for run time ABEND's (it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the ABEND occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc) in the JCL. If none of these are helpful, use judgment and DISPLAY to localize the source of error. Some installation might have batch program debugging tools. Use them. 56 How is sign stored in Packed Decimal fields and Zoned Decimal fields? Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits) of the storage. Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite. 57 How is sign stored in a comp-3 field? It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc… 58 How is sign stored in a COMP field? It is stored in the most significant bit. Bit is ON if -ve, OFF if +ve. 59 What is the difference between COMP and COMP-3? COMP is a binary storage format while COMP-3 is packed decimal format. 60 What is COMP-1 and COMP-2? COMP-1 - Single precision floating point. It uses 4 bytes. COMP-2 - Double precision floating point. It uses 8 bytes. 61 How do you define a variable of COMP-1 and COMP-2? There is no picture clause to be given. Example 01 WS-VAR USAGE COMP-1 62 How many bytes do a S9 (7) COMP-3 field occupy? It will take 4 bytes to occupy. Sign is stored as hex value in the last nibble. General formula is INT((n/2) + 1)), where n=7 in this example. 63 What is COMP SYNC? Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT. For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster. 64 How do you reference the following file formats from COBOL programs? Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 . Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4 Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4. ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL. KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB). 65 What are the differences between COBOL and COBOL II? There are at least five differences: COBOL II supports structured programming by using in line Performs and explicit scope terminators, It introduces new features (EVALUATE, SET. TO TRUE, CALL. BY CONTEXT, etc) It permits programs to be loaded and addressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER, ISAM, Etc.), and It offers enhanced CICS support. 66 What is an explicit scope terminator? A scope terminator brackets its preceding verb, e.g. IF... END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, and EVALUATE, SEARCH and STRING. 67 What is an in line PERFORM? When would you use it? Anything else you wish to say about it. The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs. 68 What is the difference between NEXT SENTENCE and CONTINUE? NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It is safest to use CONTINUE rather than NEXT SENTENCE in COBOL II. 69 What is the significance of above the line and below the line? Before IBM introduced MVS/XA architecture in the 1980's a program's virtual storage was limited to 16 Megs. Programs compiled with a 24 bit mode can only address 16 Mb of space, as though they were kept under an imaginary storage line. With COBOL II a program compiled with a 31 bit mode can be ‘above the 16 Mb line. (This ‘below the line', ‘above the line' imagery confuses most mainframe programmers, who tend to be a literal minded group.) 70 What was removed from COBOL in the COBOL II implementation? Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE. 71 Explain call by context by comparing it to other calls? The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified. 72 What is the linkage section? The linkage section is part of a called program that ‘links' or maps to data items in the calling program are working storage. It is the part of the called program where these share items are defined. 73 What is the difference between a subscript and an index in a table definition? A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value. 74 If you were passing a table via linkage, which is preferable - a subscript or an index? Wake up - you haven't been paying attention! It is not possible to pass an index via linkage. The index is not part of the calling programs working storage. Those of us, who've made this mistake, appreciate the lesson more than others. 75 Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc? An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax's: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 76 When is a scope terminator mandatory? Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it is recommended coding practice to always make scope terminators explicit. 77 In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution? In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform. 78 In an EVALUTE statement is the order of the WHEN clauses significant? Absolutely. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results. 79 What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default? INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults. 80 What is SET TO TRUE all about, anyway? In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.) 81 What is LENGTH in COBOL II? LENGTH acts like a special register to tell the length of a group or elementary item. 82 What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands? In a binary search the table element key values must be in ascending or descending sequence. The table is ‘halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. 83 What is the point of the REPLACING option of a copy statement? REPLACING allows for the same copy to be used more than once in the same code by changing the replace value. 84 How can I tell if a module is being called DYNAMICALLY or STATICALLY? The ONLY way is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal 85 What is the difference between a DYNAMIC and STATIC call in COBOL? To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. Dynamically called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A Statically called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module. 86 What is the difference between PIC 9.99 and 9v99? PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position. 87 What is Pic 9v99 Indicates? PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point. 88 What guidelines should be followed to write a structured COBOL prgm? Use ‘evaluate' stmt for constructing cases. Use scope terminators for nesting. Use in line performs stmt for writing ‘do ‘constructions. Use test before and test after in the perform stmt for writing do-while constructions. 89 What is the difference between SEARCH and SEARCH ALL? What is more efficient? SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items. 90 What care has to be taken to force program to execute above 16 Meg line? Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE (MAX). BUFSIZE can be 2K, efficient enough. 91 How do you submit JCL via a COBOL program? Use a file //dd1 DD sysout=(*, intrdr)write your JCL to this file. Pl some on try this out. 92 How to execute a set of JCL statements from a COBOL program? Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements. 93 Give some advantages of REDEFINES clause? 1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location. 2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself. 3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000 Problem.) 94 What is the difference between static call and Dynamic call? In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called program 95 What do you feel makes a good program? A program that follows a top down approach. It is also one that other programmers or users can follow logically and is easy to read and understand. 96 How do you code COBOL to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL? Using JCL with sysin. //sysin dd *here u code the parameters (value) to pass in to Cobol program /* and in program you use accept variable name (one accept will read one row)/.another way. 2) in jcl using parm statement ex: in exec statement parm='john','david' in Cobol pgm u have to code linkage section in that for first value you code length variable and variable name say, abc pic x(4).it will take john inside to read next value u have to code another variable in the same way above mentioned. 97 Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space ? Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes. 98 Differentiate COBOL and COBOL-II. (Most of our programs are written in COBOLII, so, it is good to know, how, this is different from COBOL)? The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA. 99 Describe the difference between subscripting and indexing? Indexing uses binary displacement. Subscripts use the value of the occurrence. 100 What is the LINKAGE SECTION used for? The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program. 101 What is the Purpose of POINTER Phrase in STRING command? The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored 102 What is the Importance of GLOBAL clause According to new standards of COBOL? When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL. 103 Difference between next and continue clause? The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used. 104 What is difference between COBOL and VS COBOL II? In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster. 105 What is the difference between external and global variables? Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library. 106 What happens when we move a comp-3 field to an edited (say z (9). ZZ-)? The editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired. 107 What divisions, sections and paragraphs are mandatory for a COBOL program? IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program. 108 What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL programming? Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. 109 What is the different between index and subscript? Subscript refers to the array of occurrence, where as Index represents an occurrence of a table element. An index can only modified using perform, search & set. Need to have an index for a table in order to use SEARCH and SEARCH All. 110 What is Redefines clause? Redefines clause is used to allow the same storage allocation to be referenced by different data names. 120. How many sections are there in data division? SIX SECTIONS FILE SECTION WORKING-STORAGE SECTION LOCAL-STORAGE SECTION SCREEN SECTION REPORT SECTION LINKAGE SECTION COBOL Questions and Answers pdf Download Read the full article
0 notes
siva3155 · 6 years ago
Text
300+ TOP COBOL Interview Questions and Answers
COBOL Interview Questions for freshers experienced :-
1. What is COBOL? COBOL is abbreviated as Common Business Oriented Language and it is one of the oldest programming languages. It primarily used for business, finance and administrative systems for companies. 2. What is the use of EVALUATE statement? Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no ‘break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made. 3. How do you come out of an EVALUATE statement? After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code. 4. What is a scope terminator Give example? Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF. 5. When would you use in-line perform? When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate Para and use PERFORM Para name rather than in-line perform. 6. What the difference is between CONTINUE and NEXT SENTENCE ? They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 0 then next sentence end if display ‘line 1' display ‘line 2'. display ‘line 3'. Note- there is a dot (.) only at the end of the line. 7. How many bytes does a S9(7) COMP-3 field occupy? It will take 4 bytes. Sign is stored as hex value in the last nibble. General formula is INT((n2) + 1)), where n=7 in this example. 8. What is Static and Dynamic linking? In static linking, the called subroutine is link-edited into the calling program, while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state. 9. What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY) (applicable to only MVSESA Enterprise Server) ? These are compile link edit options. AMODE stands for Addressing mode and RMODE for Residency mode. AMODE(24) - 24 bit addressing; AMODE(31) - 31 bit addressing AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31-bit programs that call 24-bit programs. (OSVS Cobol pgms use 24-bit addresses only). RMODE(ANY) - Can reside above or below 16 Meg line. 10. What is SSRANGE, NOSSRANGE? These are compiler options with respect to subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.
Tumblr media
COBOL Interview Questions 11. How do you set a return code to the JCL from a COBOL program? Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program. 12. How can you submit a job from COBOL programs? Write JCL cards to a dataset with xxxxxxx SYSOUT= (A, INTRDR) where ‘A' is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file. 13. What are the differences between OS VS COBOL and VS COBOL II? OSVS Cobol pgms can only run in 24-bit addressing mode, VS COBOL II pgms can run either in 24 bit or 31-bit addressing modes. Report writer is supported only in OSVS Cobol. USAGE IS POINTER is supported only in VS COBOL II. Reference modification e.g. WS-VAR(12) is supported only in VS COBOL II. EVALUATE is supported only in VS COBOL II. Scope terminators are supported only in VS COBOL II. OSVS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds. Under CICS Calls between VS COBOL II programs are supported 14. What are the steps you go through while creating a COBOL program executable? DB2 precompiled (if embedded SQL used), CICS translator (if CICS pgm), COBOL compiler, Link editor. If DB2 program, create plan by binding the DBRMs. 15. Can you call an OS VS COBOL pgm from a VS COBOL II pgm ? In non-CICS environment, it is possible. In CICS, this is not possible. 16. What is an in line PERFORM When would you use it anything else to say about it? The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line, PERFORM's work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs. 17. What COBOL construct is the COBOL II EVALUATE meant to replace? EVALUATE can be used in place of the nested IF THEN ELSE statements. 18. Explain how to differentiate call by context by comparing it to other calls? The parameters passed in a call by context are protected from modification by the called program. In a normal call, they can be modified. 19. Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax's 1) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 20. What is the difference between comp and comp-3 usage Explain other COBOL usages? Comp is a binary usage, while comp-3 indicates packed decimal. The other common usage's are binary and display. Display is the default. 21. What is the default value(s) for an INITIALIZE? What keyword will allow for an override of the default? INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults. 22. What is the difference between a binary search and a sequential search what are the pertinent COBOL? In a binary search, the table element key values must be in ascending or descending sequence. The table is ‘halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search, the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. 23. Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space? Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes. 24. How do you differentiate between COBOL and COBOL-II? The following features are available with VS COBOL II MVSXA and MVSESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. VMXA and VMESA support the compiler and the object programs it produces can be run in either24- or 31-bit addressing mode. VSEESA supports the compiler and the object programs it produces can be run under VSEESA. 25. What is PERFORM what is VARYING? The PERFORM statement is a PROCEDURE DIVISION statement which transfers control to one or more specified procedures and controls as specified the number of times the procedures are executed. After execution of the specified procedures is completed (i.e., for the appropriate number of times or until some specified condition is met), control is transferred to the next executable statement following the PERFORM statement. There are 5 types of PERFORM statements Basic PERFORM PERFORM TIMES PERFORM UNTIL PERFORM VARYING IN-LINE PERFORM 26. What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL? Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. 27. Why do we code s9 (4) comp In spite of knowing comp-3 will occupy less space? Here s9(4)comp is small integer, so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 12 byte.4 words equal to 2 bytes and sign will occupy 12 byte so totally it will occupy 3 bytes. 28. What are the different forms of EVALUATE statement? EVALUATE SQLCODE ALSO FILE-STATUS WHEN A=B AND C=D WHEN 100 ALSO ‘00' imperative stmt imperative stmt WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32' imperative stmt imperative stmt WHEN OTHER WHEN OTHER imperative stmt imperative stmt END-EVALUATE END-EVALUATE EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE WHEN 100 ALSO TRUE WHEN 100 ALSO A=B imperative stmt imperative stmt WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4) imperative stmt imperative stmt 29. Is it possible that the REDEFINES clause has different picture clauses compared to the one it redefined? Yes, we can have different PIC clauses. E.g.: 05 REGULAR-EMPLOYEES 10 LOCATION PICTURE A(8) 10 GRADE PICTURE X(4) 10 SEMI-MONTHLY-PAY PICTURE 9999V99 10 WEEKLY-PAY REDEFINES SEMI-MONTHLY-PAY PICTURE 999V999 05 TEMPORARY-EMPLOYEE REDEFINES REGULAR-EMPLOYEE 10 LOCATION PICTURE A(8) 10 FILLER PICTURE X(6) 10 HOURLY-PAY PICTURE 99V99 30. How you can read the file from bottom? The question is very general. Let us look into these possibilities: QSAM (sequential) file: You can run it thru SORT utility adding SEQNUM and then sort then sort by SEQNUM in DESC order VSAM: In CICS, you can read backward using READREV; VSAM: I Batch, unload the VSAM file using SORT in DESC order by key value 31. If you are current on the owner of a set, what is the difference between obtain next and obtain first? There is no, difference. There is a difference between obtain first and obtain next for an area sweep, but not when current on the owner in a set. 32. What is a bind? Binding is a process that creates the access path logic for the sql statements within a COBOL program. After precompilation of a COBOL program a dbrm (has all the embedded sql statements) is created. This dbrm is then bound to form a plan (executable form of the sql statements). 33. Why would you use find and get rather than to obtain? Find tells you whether the record is actually in the database. If it is not found you save the overhead to obtain. 34. What is an area sweep and when is it used? An area sweep accesses records based on the physical location in a database area. It can be total, meaning a record-by-record search of the area, or it can be of occurrences of records of a specific type. 35. What does a status return code of nn29 mean in relation to record locks? nn29 means that two run units are waiting to set locks on the same record and are in deadlock. 36. How are record locks released? Locks are released by a change in currency or by a commit, rollback, or finish command. 37. What are the types of record locks and how are they set? Locks may be shared or exclusive. Shared means that other run units can retrieve the record but cannot modify it. Exclusive means that other run units can neither retrieve nor modify it. Record locks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command. 38. Name the divisions, which are available in a COBOL program? IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION. 39. What are the different data types available in COBOL? The different data types available in COBOL are Alphanumeric (X), alphabetic (A) and numeric (9). 40. What does the INITIALIZE verb do? Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER OCCURS DEPENDING ON items left untouched. 41. What are 77 levels used for? It is used in Elementary level item. It cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves. 42. What does the IS NUMERIC clause establish? IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. “IS NUMERIC” return TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and -. 43 How do you define a table/array in COBOL? ARRAYS. 05 ARRAY1 PIC X(9) OCCURS 10 TIMES. 05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX. 44. What is the difference between index and subscript? Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET. Need to have index for a table in order to use SEARCH, SEARCH ALL. 45. What is the difference between SEARCH and SEARCH ALL? SEARCH - is a serial search. SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL. 46. What should be the sorting order for SEARCH ALL? It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order). 47. What is binary search? Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies. 48. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not ABEND. What is wrong with it? Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE. 49. How do you sort in a COBOL program Give sort file definition, sort statement syntax and meaning? Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY…. USING file-2 GIVING file-3. USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING It can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2. file-1 is the sort (work) file and must be described using SD entry in FILE SECTION. file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-3 is the out file from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-1, file-2 & file-3 should not be opened explicitly. INPUT PROCEDURE is executed before the sort and records must be released to the sort work file from the input procedure. OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be returned one at a time to the output procedure. 50. How do you define a sort file in JCL that runs the COBOL program? Use the SORTWK01, SORTWK02… dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required. 51 What is the difference between performing a SECTION and a PARAGRAPH? Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. Performing a PARAGRAPH will cause only that paragraph to be performed. 52 What the difference is between CONTINUE and NEXT SENTENCE? They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 > 0 then next sentence end if display ‘line 1' display ‘line 2' display ‘line 3'. *** Note- there is a dot (.) only at the end of the last 2 statements, see the effect by replacing Next Sentence with Continue *** 53 What does EXIT do? Does nothing! If used, must be the only sentence within a paragraph. 54 Can I redefine an X(100) field with a field of X(200)? Yes. Redefines just causes both fields to start at the same location. For example: 01 WS-TOP PIC X(1) 01 WS-TOP-RED REDEFINES WS-TOP PIC X(2). If you MOVE ‘12' to WS-TOP-RED, DISPLAY WS-TOP will show 1 while DISPLAY WS-TOP-RED will show 12. 55 What do you do to resolve SOC-7 error? Basically you need to correct the offending data. Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Many installations provide you a dump for run time ABEND's (it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the ABEND occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc) in the JCL. If none of these are helpful, use judgment and DISPLAY to localize the source of error. Some installation might have batch program debugging tools. Use them. 56 How is sign stored in Packed Decimal fields and Zoned Decimal fields? Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits) of the storage. Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite. 57 How is sign stored in a comp-3 field? It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc… 58 How is sign stored in a COMP field? It is stored in the most significant bit. Bit is ON if -ve, OFF if +ve. 59 What is the difference between COMP and COMP-3? COMP is a binary storage format while COMP-3 is packed decimal format. 60 What is COMP-1 and COMP-2? COMP-1 - Single precision floating point. It uses 4 bytes. COMP-2 - Double precision floating point. It uses 8 bytes. 61 How do you define a variable of COMP-1 and COMP-2? There is no picture clause to be given. Example 01 WS-VAR USAGE COMP-1 62 How many bytes do a S9 (7) COMP-3 field occupy? It will take 4 bytes to occupy. Sign is stored as hex value in the last nibble. General formula is INT((n/2) + 1)), where n=7 in this example. 63 What is COMP SYNC? Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT. For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster. 64 How do you reference the following file formats from COBOL programs? Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 . Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4 Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4. ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL. KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB). 65 What are the differences between COBOL and COBOL II? There are at least five differences: COBOL II supports structured programming by using in line Performs and explicit scope terminators, It introduces new features (EVALUATE, SET. TO TRUE, CALL. BY CONTEXT, etc) It permits programs to be loaded and addressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER, ISAM, Etc.), and It offers enhanced CICS support. 66 What is an explicit scope terminator? A scope terminator brackets its preceding verb, e.g. IF... END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, and EVALUATE, SEARCH and STRING. 67 What is an in line PERFORM? When would you use it? Anything else you wish to say about it. The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs. 68 What is the difference between NEXT SENTENCE and CONTINUE? NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It is safest to use CONTINUE rather than NEXT SENTENCE in COBOL II. 69 What is the significance of above the line and below the line? Before IBM introduced MVS/XA architecture in the 1980's a program's virtual storage was limited to 16 Megs. Programs compiled with a 24 bit mode can only address 16 Mb of space, as though they were kept under an imaginary storage line. With COBOL II a program compiled with a 31 bit mode can be ‘above the 16 Mb line. (This ‘below the line', ‘above the line' imagery confuses most mainframe programmers, who tend to be a literal minded group.) 70 What was removed from COBOL in the COBOL II implementation? Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE. 71 Explain call by context by comparing it to other calls? The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified. 72 What is the linkage section? The linkage section is part of a called program that ‘links' or maps to data items in the calling program are working storage. It is the part of the called program where these share items are defined. 73 What is the difference between a subscript and an index in a table definition? A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value. 74 If you were passing a table via linkage, which is preferable - a subscript or an index? Wake up - you haven't been paying attention! It is not possible to pass an index via linkage. The index is not part of the calling programs working storage. Those of us, who've made this mistake, appreciate the lesson more than others. 75 Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc? An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax's: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 76 When is a scope terminator mandatory? Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it is recommended coding practice to always make scope terminators explicit. 77 In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution? In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform. 78 In an EVALUTE statement is the order of the WHEN clauses significant? Absolutely. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results. 79 What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default? INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults. 80 What is SET TO TRUE all about, anyway? In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.) 81 What is LENGTH in COBOL II? LENGTH acts like a special register to tell the length of a group or elementary item. 82 What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands? In a binary search the table element key values must be in ascending or descending sequence. The table is ‘halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. 83 What is the point of the REPLACING option of a copy statement? REPLACING allows for the same copy to be used more than once in the same code by changing the replace value. 84 How can I tell if a module is being called DYNAMICALLY or STATICALLY? The ONLY way is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal 85 What is the difference between a DYNAMIC and STATIC call in COBOL? To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. Dynamically called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A Statically called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module. 86 What is the difference between PIC 9.99 and 9v99? PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position. 87 What is Pic 9v99 Indicates? PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point. 88 What guidelines should be followed to write a structured COBOL prgm? Use ‘evaluate' stmt for constructing cases. Use scope terminators for nesting. Use in line performs stmt for writing ‘do ‘constructions. Use test before and test after in the perform stmt for writing do-while constructions. 89 What is the difference between SEARCH and SEARCH ALL? What is more efficient? SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items. 90 What care has to be taken to force program to execute above 16 Meg line? Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE (MAX). BUFSIZE can be 2K, efficient enough. 91 How do you submit JCL via a COBOL program? Use a file //dd1 DD sysout=(*, intrdr)write your JCL to this file. Pl some on try this out. 92 How to execute a set of JCL statements from a COBOL program? Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements. 93 Give some advantages of REDEFINES clause? 1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location. 2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself. 3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000 Problem.) 94 What is the difference between static call and Dynamic call? In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called program 95 What do you feel makes a good program? A program that follows a top down approach. It is also one that other programmers or users can follow logically and is easy to read and understand. 96 How do you code COBOL to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL? Using JCL with sysin. //sysin dd *here u code the parameters (value) to pass in to Cobol program /* and in program you use accept variable name (one accept will read one row)/.another way. 2) in jcl using parm statement ex: in exec statement parm='john','david' in Cobol pgm u have to code linkage section in that for first value you code length variable and variable name say, abc pic x(4).it will take john inside to read next value u have to code another variable in the same way above mentioned. 97 Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space ? Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes. 98 Differentiate COBOL and COBOL-II. (Most of our programs are written in COBOLII, so, it is good to know, how, this is different from COBOL)? The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA. 99 Describe the difference between subscripting and indexing? Indexing uses binary displacement. Subscripts use the value of the occurrence. 100 What is the LINKAGE SECTION used for? The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program. 101 What is the Purpose of POINTER Phrase in STRING command? The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored 102 What is the Importance of GLOBAL clause According to new standards of COBOL? When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL. 103 Difference between next and continue clause? The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used. 104 What is difference between COBOL and VS COBOL II? In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster. 105 What is the difference between external and global variables? Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library. 106 What happens when we move a comp-3 field to an edited (say z (9). ZZ-)? The editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired. 107 What divisions, sections and paragraphs are mandatory for a COBOL program? IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program. 108 What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL programming? Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. 109 What is the different between index and subscript? Subscript refers to the array of occurrence, where as Index represents an occurrence of a table element. An index can only modified using perform, search & set. Need to have an index for a table in order to use SEARCH and SEARCH All. 110 What is Redefines clause? Redefines clause is used to allow the same storage allocation to be referenced by different data names. 120. How many sections are there in data division? SIX SECTIONS FILE SECTION WORKING-STORAGE SECTION LOCAL-STORAGE SECTION SCREEN SECTION REPORT SECTION LINKAGE SECTION COBOL Questions and Answers pdf Download Read the full article
0 notes
aqdenostre · 13 years ago
Audio
Die „Menschine“ ist gestartet …
0 notes