dimpy


{ City } bangalore
< Country > india
* Profession *
User No # 119646
Total Questions Posted # 36
Total Answers Posted # 41

Total Answers Posted for My Questions # 27
Total Views for My Questions # 59304

Users Marked my Answers as Correct # 11
Users Marked my Answers as Wrong # 3
Questions / { dimpy }
Questions Answers Category Views Company eMail

How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length ----TRY

JCL 966

have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file

JCL 1048

How to read records in reverse order in flat file?

1 JCL 1666

what modification we need to do in jcl if we use sort in cobol? I mean whether we need to include temporary file used for sorting in assign statement?

1 JCL 1722

what is the difference between perform varying and perform

1 JCL 1718

difference between internal sort and external sort

1 JCL 1767

i want to store 20 digits . how will u do it in cobol ?

JCL 960

01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250

1 JCL 1768

WORKING-STORAGE SECTION. 01 GROSS-PAY. 05 BASIC-PAY PIC 9(5). 05 ALLOWENCES PIC 9(3). PROCEDURE DIVISION. MOVE 1000 TO BASIC-PAY. MOVE 250 TO ALLOWENCES. DISPLAY GROSS-PAY. STOP RUN. 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

JCL 945

WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375

JCL 1152

what if any ,is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

1 JCL 2223

01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

1 JCL 1630

WORKING-STORAGE SECTION. 1 GROUP-ITEM. 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50. 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP. PROCEDURE DIVISION. MOVE ZERO TO GROUP-ITEM. ADD 50 TO AMOUNT-1. DISPLAY AMOUNT-1. STOP RUN.

1 JCL 1638

consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayed after the PERFORM is over? assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above

1 JCL 1805

//S10 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=VAR.INPUT1,DISP=SHR // DD DSN=VAR.INPUT2,DISP=SHR //OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,5)),UNIT=SYSDA //TOOLIN DD * * Splice the needed data from the two VB files together SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL - WITH(12,5) WITH(22,20) VLENMAX /*

JCL 1013


 [1]   2   3    Next



Answers / { dimpy }

Question { Atos Origin, 11358 }

How 10 Digits are stored in Packed Decimal?


Answer

Correct me if I am wrong
here value should be 6
as 1 space will be taken for sign(+/-)
and every byte will take 2 digit
10 digit + 1 sign = 11
hence 6*2 = 12
hence value should be 6.

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 13069 }

what is the result of the following?

DIVIDE A INTO B GIVING C.

a.C=A/B
b.the reminder of B/A is stored in C
c.C=B/A
d.the reminder of A/B is stored in C


Answer

c. B/A

Is This Answer Correct ?    0 Yes 0 No


Question { TCS, 7750 }

which of the following can be used as a check protection symbol
a.Z
b.S
c.*
d.+


Answer

* A check protect symbol--a leading numeric character position into which an asterisk is placed when that position contains a zero. Each asterisk (*) is counted in the size of the item.

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 7114 }

study the following code
01 A1
05 B PIC 99
05 C PIC X(4)
01 A2
05 B PIC 99V99
05 C PIC A(4)
pick out the valid statement from the following
a.A1 and A2 can not have sub-ordinates
b.A1 and A2 can have the same sub-ordinates but must have
same PIC clause
c.there is nothing wrong
d.A1 and A2 can have same sub-ordinates provided they are
not at 01 level


Answer

c.there is nothing wrong
WORKING-STORAGE SECTION.
01 A1.
05 B PIC 99.
05 C PIC X(4).
01 A2.
05 B PIC 99V99.
05 C PIC A(4).
PROCEDURE DIVISION.
DISPLAY 'HELLO'.
STOP RUN.

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 8157 }

study the following
01 A PIC 99V0 VALUE 5
01 B PIC 9V9 VALUE 6
01 C PIC 99V9 VALUE 2.5
01 D PIC 99 VALUE 3
COMPUTE A ROUNDED B C = A+B*C/D
ON SIZE ERROR PERFORM PRINT-ERROR
the comments of A.B.C after execution of the above
statement are
a.A=10 B=0 C=10
b.A=10 B=9.9 C=9.9
c.A=10 B=0 C=9.9
d.A=10 B=6 C=10


Answer

10A
6 B
10C

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 5828 }

consider the following two IF statements:
IF X AND NOT Y MOVE A TO B
IF Z=1 OR 9 MOVE A TO B
select one of the following data divusion entries which
gives identical
results for both the above IF statements
a.01 Z PIC 9
88 X VALUE 1.9
88 Y VALUE 0.2 THRU 8
b.01 Z PIC 9
88 X VALUE 0.2 THRU 8
Y VALUE 1.9
c.01 Z PIC 9
88 X VALUE 1.9
88 NOT-Y VALUE 0.2 THRU 1.9
d.none of yhe above


Answer

there should not be any PIC clause defination on 01 level
01 Z PIC 9

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 69555 }

How to read records from flat file in reverse order through
COBOL program?


Answer

1. Using FileAid

//STEP0100 EXEC PGM=FILEAID

//SYSPRINT DD SYSOUT=*

//DD01 DD DSN=YOUR INPUT DATASET,DISP=SHR

//DD01O DD DSN=YOUR OUTPUT FILE IN REVERSE ORDER,

// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,

// SPACE=(CYL,(X,Y),RLSE)

//SYSIN DD *

$$DD01 COPYBACK

/*

Is This Answer Correct ?    1 Yes 0 No

Question { IBM, 69555 }

How to read records from flat file in reverse order through
COBOL program?


Answer

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT DATASET,DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE IN REVERSE ORDER,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTREC FIELDS=(1,80)
/*

Is This Answer Correct ?    4 Yes 0 No

Question { IBM, 69555 }

How to read records from flat file in reverse order through
COBOL program?


Answer

When REVERSED is specified, OPEN statement execution positions the QSAM file at its end. Subsequent READ statements make the data records available in reversed order, starting with the last record


Open INPUT filename REVERSED

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 16920 }

How to define variable 9(20) in COBOL, because compiler
does not allow us to declare variables with Pic 9(18). Can
anyone please let me know the answer... I know one answer
to this question which is to use Compiler option Arith
(Extend) during Compilation. It extends the maximum limit
to 9(32)..Just wanted to know if there is any other way to
extend this?


Answer

try with this:

01 VARIABLE-ABC.
03 VAR-1 PIC 9(18).
03 VAR-2 PIC 9(2).




or
use PROCESS ARITH(EXTEND) before IDENTIFICATION DIVISION

ARITH option syntax

.-COMPAT-.
>>-ARITH(-+-EXTEND-+-)-----------------------------------------><


When you specify ARITH(EXTEND):
The maximum number of digit positions that you can specify in the PICTURE clause for packed-decimal, external-decimal, and numeric-edited data items is raised from 18 to 31.

Is This Answer Correct ?    0 Yes 0 No

Question { IBM, 6238 }

Consider the below example

call a-test1.
--
--
--
a-test1.
if a=b
perform a-test through a-exit
next sentence
else
if b=c
perform c-test through c-exit.
if a=d
perform d-test through d-exit.
a-test.
--
--
a-exit.
exit.

can u tell me what will happen if a=b
after looping into a-exit will the control go back to a-
test1.

will the condition a=d be checked???


Answer

Compilation Error.
both NEXT SENTENCE and CONTINUE place holder.
above situation NEXT SENTENCE will give compilation error
CONTINUE will not generate compilation error

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 9989 }

01 A pic 9(100) find record length of it


Answer

----TRY
Compilation error ---
IGYDS1145-S More than 18 digit positions were specified in a "PICTURE
"PICTURE" string of "S9(18)" was assumed.

run error ----
03.21.40 JOB33062 £HASP165 SIQAGHB ENDED AT OSPART - ABENDED S706 U0000 CN(INT
ERNAL)
***

Is This Answer Correct ?    2 Yes 1 No

Question { TCS, 12714 }

ID DIVISION.
PROGRAM-ID. PLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VAR1 PIC 9(2).
01 VAR2 PIC X(2).
PROCEDURE DIVISION.
ACCEPT VAR2.
MOVE VAR2 TO VAR1.
STOP RUN.

if i give 'PI' in var2 then what will b output of progr.
any abend?????


Answer

No abend
but unpredictable result

WORKING-STORAGE SECTION.
01 VAR1 PIC 9(2).
01 VAR2 PIC X(2).
PROCEDURE DIVISION.
ACCEPT VAR2.
MOVE VAR2 TO VAR1.
DISPLAY VAR1.
DISPLAY VAR2.
STOP RUN.


//STEP02 EXEC PGM=COB7
//STEPLIB DD DSN=DEA.SIQAGH.LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
PI
/*



output
P9
PI

Is This Answer Correct ?    0 Yes 0 No

Question { TCS, 11353 }

have in 100 records in a flat file i want to move records
like 1,3,5,7,9,11,.. to Output file1 and
2,4,6,8,10,12,14 .. records moved to Output file2..Pls
Provide real time answer..


Answer

FILE-CONTROL.
SELECT INP ASSIGN TO INF
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INP
RECORDING MODE IS F.
01 INP-REC.
10 STUDENT-ID PIC 9(3).
10 STUDENT-NAME PIC X(20).
FILE-CONTROL.
SELECT INP ASSIGN TO INF
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD INP
RECORDING MODE IS F.
01 INP-REC.
10 STUDENT-ID PIC 9(3).
10 STUDENT-NAME PIC X(20).
WORKING-STORAGE SECTION.
01 C PIC 99 VALUE ZEROS.
01 D PIC 99V99 VALUE ZEROS.
01 E PIC 99.99.
01 I PIC 99 VALUE ZEROS.
01 WS-INP-REC.
10 WS-STUDENT-ID PIC 9(3).
10 WS-STUDENT-NAME PIC X(20).
05 EOF PIC X VALUE 'N'.
01 PRINT-CHAR PIC X(20).
PROCEDURE DIVISION.
OPEN INPUT INP.
READ INP INTO WS-INP-REC.
PERFORM UNTIL EOF = 'Y'
ADD 1 TO I
DISPLAY I
DIVIDE 2 INTO I GIVING C REMAINDER D
MOVE D TO E
DISPLAY E
IF (D IS ZERO)THEN
DISPLAY WS-STUDENT-NAME
END-IF
READ INP INTO WS-INP-REC AT END MOVE 'Y' TO EOF
END-READ
END-PERFORM.
CLOSE INP.
GOBACK.

output :
01
01.00
02
00.00
BRPITA
03
01.00
04
00.00
DRPITA
05
01.00
06
00.00
FRPITA

input :
000001 070 ARPITA
000002 080 BRPITA
000003 090 CRPITA
000004 100 DRPITA
000005 110 ERPITA
000006 120 FRPITA

Is This Answer Correct ?    0 Yes 1 No

Question { 1666 }

How to read records in reverse order in flat file?


Answer

I know we can do it by reading all records into an array....
Then read records in reverse order by using subscript or index
but can any body give me the exact code.

--read the record in index and access it backward using index or subscript

Is This Answer Correct ?    0 Yes 0 No

 [1]   2   3    Next