What is difference between s9(04) comp and 9(04) comp? (cobol comp with s and without s)
Both are binary, please see the below link for more info:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IGY3PG50/1.3.4.7?DT=20090820210412
9(4) will always be treated as a positive number and s9(4) may be either positive or negative.
S signifies Signed variable. So S9(04)comp will have value -/+ 2 (Binary) whereas 9(04)comp will have value as 2 (Numeric)
How will you analyze a cobol program?
Hi, i was asked in interview how would you analyze a cobol program? i gave the ans as there are many kind of analyses -: requirement analysis root cause analysis impact analysis problem / logic analysis but in general we talk about problem finding in a program and told him we would first go in for...
Second part of your answer seems satisfactory. You should have asked the interviewer for what we need to analyze, if its just for document purpose, then your answer is right. If its for a change, then there are specific areas we need to analyze for the changes impact.
What is linkage section? Can we use this concept when there's no called program?
When there is PARM passed from JCL, we need Linkage Section in COBOL program even when there is no called program.
How can you use the concept of Linkage section in the manner you have specified.. Where do you intend to populate these values from and where do you intend to send the values back? It is not possible ...
What is difference between initialize and value?
value : value clause is used to initialize values at working storage section only. i.e.., giving the values at declaration time initialize : this verb is used in 2 ways. 1) used to supply the init...
INITIALIZE verb is used to refresh the alphabetic & alphanumeric empty fields with SPACES and numeric empty fields with ZEROS
I tried implementing this in mainframes.. Neither it has given compilation error nor abended when executing the program.
Result is : both the fields holds "abcde".
SOC7 ERROR bcaz whenever ws-var1 is redefined by ws-var2 (num),the numeric pic 9(5) stands in-front of Alphanumeric pic x(5) and so it takes the values anything that comes to ws-var1.if once any varia...
What is the use of level 49 in cobol?
The level number 02 to 49 are use to specify the group and elementary data items within a record.
Although level 02-49 level are group or elementry elements but sometimes 49 are used for dynmic SQL, i.e.01 WS-SQl-statement1-VARIABLE. 49 WS-SQL-STATEMENT1-LEN &nbs...
Culd any body tell the concept for the prime number programe?
set the start and end limit from which prime will calculate. then start first for loop and second for loop. "cobol DATA DIVISION. WORKING-STORAGE SECTION. 77 I PIC 999 VALUE 001. ...
1. You dont need to loop further than the integer of the square root of the number in question
2. You can skip multiples of numbers already checked (if a number is not divisible by 2 then its not by 4 either)
Ans: b. only A,C and D are TRUE
The answer is C. This is because whenever a condition is evaluated first the condition is bracket is evaluated and then AND and then OR.Also True AND True is True. True OR True is T...
Concatinating two rec by using cobol & jcl
I need to concatenate records by using cobol and jcl (both) as follows. input file: aaaaa bbbbb ccccc ddddd 11111 22222 33333 44444 split the file into two halves and 1st rec of first half and 2nd rec of second half records are concatinated and 2nd rec of first half and 2nd rec of second half records...
1. Split the INPUT File into two halves and generate the SEQNUM for each record.
2. Then Join the two files on SEQNUM and Reformat the fields in required format.
What is redefine in cobol?
Truncation happens from left to right.
Its Just like a type conversion If we are having a field in database as alphanumeric and we want to superate the $ symbol and superate the numeric value for calculation as follows ...
What will happen if a cursor is opened again before closing?
A cursor is opened.After fetching few rows. It is opened again before closing it.What will be the result?
It give -502 error code i.e already the cursor was opened
If cursor is opened again before closing The error will be happen as Cursor already opened. Error code is 501
Rgds
Rasipuram Manivannan M
Contact: =91-9486115495
Tested the prog actually on Mf
Ans is :
A B C :100 00 100
answer is d
c=10
Can redefines clause be used in file section, if yes at which level number ?
except 66 and 88 levels it will work.
Cant used redefines clause in file-section.
C=B/A
c.C=B/A
Called and calling program for cobol with cursor
I have program a which is calling b first time. B program is feaching data using cursor , but some mess happened and the control went back to pro a without closing cursor . Once again program a called program b then what will happen to cursor. Will program fetch the data.
Program B will throw an error while it is trying to open the cursor again, which is already opened.
by using reference modification...... IDENTIFICATION DIVISION. PROGRAM-ID. REVSTRN. ENVIRONMENT DIVISION. ...
Have you tried doing this -
Code
MOVE FUNCTION REVERSE(WS-A) TO WS-B
Can a third level redefining possible in cobol? 01 b redefines a 05 a pic x(2) 01 C redefines b 01 d redefines C
Yes....it is possible...multiple redefines possible......
b.b23.75 (where b indicates space)
Answer is : b23.75
Bacause W-A 's original value is 023.75
& W-B's original value is 123.45
After moving W-A's value to W-B Z replaces the 0 as blank.
(B) 4 times
(C) 8 times
Just to add, my two cents: Data items in the LOCAL-STORAGE SECTION are automatically allocated for each instance of a program invocation. When a program runs in multiple threads simultaneously, each ...
Local storage section is a section of Data Division of Cobol which is similar to the Working storage section. The only difference being that the variables in the Local Storage always get initialised w...