i have a sequencial file contains multiple records, i want
to extract one row which contains various fields like order
number,date,warehouse,.ect.. in to the another file by
accepting the order number from jcl. how can i do it. pls
help me..

Answers were Sorted based on User's Feedback



i have a sequencial file contains multiple records, i want to extract one row which contains vario..

Answer / abhijit18in2002

Input file: ABCD.UTIL.SAMP has following records

Order Warehouse Place Date
10012,COMPUTER,INDIA,20090805
10013,COMPUTER,INDIA,20090805
10014,COMPUTER,INDIA,20090805
10015,COMPUTER,INDIA,20090805
10016,COMPUTER,INDIA,20090805
10017,COMPUTER,INDIA,20090805

//COUNTREC JOB ,'COUNT RECORDS',
// MSGCLASS=Q,CLASS=D,
// NOTIFY=&SYSUID
//STEP010 EXEC PGM=SORT,REGION=4096K
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABCD.UTIL.SAMP,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,5,CH,EQ,C'10015')
/*


SORTOUT :- Ouput in SPool

10015,COMPUTER,INDIA,20090805

Is This Answer Correct ?    12 Yes 2 No

i have a sequencial file contains multiple records, i want to extract one row which contains vario..

Answer / sowjanya

let say ur input file is like below.
FD input-file.
01 input-record.
05 order-number pic x(5).
05 order-date pic x(10). etc.
the order number passed by the JCl willbe received in cobol
thru linkage section .let say that is LS-ORDER-NUMBER.

code like below in procedure division.
Procedure division.
Read input-file until EOF
at end move 'Y' to EOF.
if order-number = ls-order-number
write out-rec from input-record.

Here the out-rec contains only one record that has order
number equals to the order number received from JCL.

Is This Answer Correct ?    7 Yes 0 No

i have a sequencial file contains multiple records, i want to extract one row which contains vario..

Answer / kk

hi,
its possible to both jcl and cobol.in jcl using sort
utilities sort fields=(1,orderno size,bi,a)

Is This Answer Correct ?    3 Yes 0 No

i have a sequencial file contains multiple records, i want to extract one row which contains vario..

Answer / nandigam

your question was not clear,the above two answer was
correct.
if have any doubt again post same question and with example

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More COBOL Interview Questions

how do you reference the variable block file formats from cobol programs

0 Answers  


What is Static and Dynamic linking ?

3 Answers  


What do you understand by passing by reference and passing by content?

1 Answers  


How do define dynamic array in cobol.

0 Answers  


What divisions, sections and paragraphs are mandatory for a COBOL program?

8 Answers   Arigo Infotech,






How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.

3 Answers  


Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.

2 Answers   RBS,


how to transfer the file from pc to mainframe??

5 Answers   TCS,


What does EXIT do ?

3 Answers   Deloitte,


How to increase the logical record length of existing PS file?

7 Answers  


where do u use low-value and high value in cobol

3 Answers   CGI,


I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..

3 Answers   iGate,


Categories