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

how can u redefine picx(10) with pic 9(6).

3 Answers   TCS,


What are some examples of command terminators?

1 Answers  


1.Can we define condition-name conditions in FD entry.

11 Answers  


should I use Go back in the main program ? Yes we can use Go back in main program as well.

2 Answers   Xansa,


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,






How can you pass values from COBOL program to non-COBOL programs?

2 Answers  


If my file contains 100,000 records and job abended at 55,000th records processing then how can i restart job from that record onward by ignoring that record. I can not edit the file as file size is big and it is getting browse substituted?

5 Answers   TCS,


01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. what would be the value of yyy

13 Answers   HSBC,


I know my query will return more than one row but I don't want cursor what should I do?

1 Answers  


Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.

12 Answers  


hi. This is Ram.i have one doubt.why can't we display comp-3 variables directly? let me answer quickly plez........

1 Answers  


how the control comes back from subprogram to mainprogram

3 Answers   IBM,


Categories