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

What is the difference between performing a SECTION and a PARAGRAPH?

5 Answers   Accenture, Patni,


What is Pic 9v99 Indicates in COBOL?

0 Answers   SwanSoft Technologies,


COMP field occupy ?

2 Answers  


1)what is use of linkage section? 2)what is difference between comp and comp-3

1 Answers   Cap Gemini,


what are the utilities for load and unload the DB2 tables

1 Answers   L&T,






TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr

1 Answers   MNC,


how can we find total no of records in a file ....is there any utility......?

3 Answers   IBM,


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 do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

7 Answers   CGI, TCS,


What is the difference between a binary search and a sequential search?

10 Answers  


What is the output generated by the following code? 01 GRP-I. 05 SUBFLD1 PIC XX VALUE "AB". 05 FILTER PIC X(6) VALUE SPACES. 01 GRP-2 REDEFINED GRP-1. 05 SUB-FLD2 PIC XX. 05 SUB-FLD3 PIC XX. 05 FILTER PIC X(4). IF SUB-FLD1 NOT = SPACES DISPLAY "SUBFLD1" MOVE "ABBCCD" TO GRP-1 IF SUB-FLD3 = SPACES DISPLAY "SPACES" ELSE DISPLAY "SUBFLD3" DISPLAY "END" ELSE DISPLAY "SPACES" DISPLAY "END". (a) SUBFLD1 SUBFLD3 END (b) SPACES END (c) SUBFLD1 END (d) SUBFLD1 SPACES

7 Answers   TCS,


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,


Categories