How to fetch even records from one file to another file by
using ICETOOL in JCL?

Answers were Sorted based on User's Feedback



How to fetch even records from one file to another file by using ICETOOL in JCL?..

Answer / harsha

//STEP1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.DATA,DISP=SHR
//OUTDATA DD DSN=OUTPUT.DATA,DISP=(NEW,CATLG,DELETE)
.
.
.
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUTDATA,SAMPLE=2

THIS WILL COPY ALL EVEN RECORDS
-------------------------------------------
FOR ODD RECORDS
OUTFIL FNAMES=OUTDATA,STARTREC=1,SAMPLE=2

Is This Answer Correct ?    5 Yes 0 No

How to fetch even records from one file to another file by using ICETOOL in JCL?..

Answer / mdv

Both solutions given above are right.

Is This Answer Correct ?    1 Yes 0 No

How to fetch even records from one file to another file by using ICETOOL in JCL?..

Answer / rajvee

Step01 exec pgm=sort
.
.
.
sysin dd *
sort fields=copy
outfil fnames(out1,out2),split

first rec will be in out1 file, second in out2,third in
out1 and so on..

so out2 will have even number recs.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More JCL Interview Questions

how do u send return code from cobol to jcl ?

2 Answers   TCS,


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

0 Answers  


how you can direct the data to spool using SYSOUT option?

0 Answers  


Mention the types of job control statements?

0 Answers  


What is the error in the following JCL statements : I) //step#three exec pgm=hkbc762 ii) //step#3 exec pgm = hkbc762 iii) //step#3 exec pgr = hkbc672

6 Answers  






I HAVE A SEQUENTIAL FILE CONTAINING ONE RECORD IN WHICH I HAVE ONE FIELD AS CUSTOMER IDENTITY NUMBER FIELD WHICH IS A SIGNED FIELD. HOW TO SEQUENTIALLY INCREMENT THIS FIELD USING OVERLAY PARAMETER?.

1 Answers  


The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The DISP in the JCL is SHR and the program opens the file in EXTEND mode. What happens ?

3 Answers  


proc1,proc2,up to proc5 is there if i want to call proc1 and proc5how can u write the code

2 Answers  


I have a JCL which 20 steps. How do I execute 17 th step alone (It should execute only 17ths tep.and it should not execute 18,19,20 steps??

9 Answers   IBM, Infosys, TCS, Xansa, Xchanging,


I am having one step in my jcl.in that step,i am calling one proc.In that proc,i have 10 steps.i want to call a particular step in that proc without writing any new jcl ike iebedit utility...

2 Answers   Satyam,


If a field is declared as a comp-3 field and if we want to sort a dataset based on this field, then how will the sort card be??? e.g- if we want to sort by a field which is defined as a PIC X(5) then we will mention - sort fields=(1,5,ch,a). Likewise if a field is defined as PIC S9(10)COMP-3 then in this case how will the sort field be defined (because in this case a sign is also involved)???

8 Answers  


how to override PROC? please give answer in details. Please mention how to write it in JCL. Thanks in advance.

6 Answers   Syntel, UHG,


Categories