hi is there any means of deletin a record from a ps usin
cobol
not using jcl?eg if i am reading a record and if some
condition is matched tat particular record must be deletd
fom the ps

Answers were Sorted based on User's Feedback



hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a..

Answer / manikandan

The above answer is do it with the JCL, if you want to do
the same with COBOL, you should be having two files, one is
input and the other one with new output file. Otherwise i
suppose we can't do it.

Is This Answer Correct ?    6 Yes 0 No

hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a..

Answer / nagesh

Fine I would like go with answer #2, since physical deletion
is not possible with ps datasets , all you can do is exclude
the records meeting the condition while writing it to new ps
datasets.
let me remind once again that Deletion is not possible with
ps data sets.

Is This Answer Correct ?    5 Yes 0 No

hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a..

Answer / saikat

take the infile and outfile same in the jcl but in 2 dd
statement. Declare one ainput file to read and other as
output file to write in cobol program. Then read the file
and srore the file contents in an array/table. after
reading the full file write the file from the array records.

Is This Answer Correct ?    0 Yes 2 No

hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a..

Answer / mani

If you open the dataset in io mode can't we delete the
record, i think we can.
If it is a flat file or vsam file i think we can delete the
record but the space being used for that will not be recovered.

Please check it.

Is This Answer Correct ?    0 Yes 4 No

hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a..

Answer / manikandan

Ofcourse you can do it. You can do it by a simple sort.
You can use either INCLUDE COND or EXCLUDE COND in the
sysin part.

Ex: If you want to delete a record whose first 4 characters
are 'BBBB', you can do it with the following sysin card,

SORT FIELDS=COPY
INCLUDE COND=(1,4,CH,NE'BBBB')

OR
SORT FIELDS=COPY
EXCLUDE COND=(1,4,CH,EQ'BBBB')

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More COBOL Interview Questions

what is the use of filler in cobol programing?

4 Answers   MAT,


What is a report item?

0 Answers  


what happens of we dont give time stamp in precompilation process

2 Answers  


consider two data items 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

5 Answers   TCS,


What is level 66 used for ?

3 Answers   TCS,






01rec1. 05 a pic 999v99 value 123.12 05 b pic 99v9 value 45.9 02 rec2. 05 x pic 999v99 05 y pic 99v99 05 z pic x(3) value 'abc' if rec1 is moved to rec2 then what is the value of rec2?

5 Answers   Amdocs,


can we redefine 77 level item is it possible

4 Answers   HCL,


What is the Importance of GLOBAL clause According to new standards of COBOL?

2 Answers   Infosys,


HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?

2 Answers  


can we read records in a file from botom to top. if possible how can we read

12 Answers   ACS,


where will we code call by content and call by reference dude pls reply soon ?

2 Answers  


what is the use of comp2 ? where can we use it with example ?

3 Answers   Covansys,


Categories