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

Explain in DD statement what is the use of DCB parameter?

0 Answers  


How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?

0 Answers  


which statement is used to end the in-stream procedure in a jcl?

1 Answers   IBM,


I have one GDG. Everyday One new version is being created.Now I want to split this created version in different files each having 1000 records. Here Problem is I don't know How many records will be there in new version of GDG? that's why I don't know How many Out files we need to use . Interesting??????????????

4 Answers   CTS,


which utility is used to update pds?

1 Answers   IBM,






How to find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?

0 Answers   IBM,


How can i execute 5th step without executing first 4 steps?

4 Answers  


how to solve u4038 abbend?........

3 Answers   Atos Origin, TCS,


What is timing concept in mainframe?

0 Answers  


Describe the EXEC statement, its meaning, syntax and keywords?

2 Answers  


What is the function of //jcllib statement?

0 Answers  


One dataset is creating in the step1 with LRECL of 133 and the same dataset is used in the next step in DISP=SHR mode, but while scanning the JCL the following error is thrwon. Please verify the below JCL $/SEPP030.PROVIDER DD DSN=Z1225BT.F5750PG9.F5910PRV.QC#A6868 //ERRORRPT DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, --ERRORRPT DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=&DISNCD,UNIT=&DELQ, -- DISP= (NEW,CATLG,DELETE),UNIT=DELQ, // SPACE=(TRK, (30,15),RLSE), // DCB=&DCB2 -- DCB= (PPG.METMODEL,BLKSIZE=0,LRECL=133,RECFM=FB) $/SEPP030.ERRORRPT DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT //SEPP040 EXEC PGM=FILEAID,COND= (0002,EQ,SEPP030) //SYSPRINT DD SYSOUT=* //SYSLIST DD SYSOUT=* //DD01 DD DSN=SYSCMN.PROD.CCLIB (F5910EP1),DISP=SHR $/SEPP040.DD01 DD DSN=Z1225BT.TEST.CCLIB (F5910EP1) E1 - DSS20791E - DATA SET 'Z1225BT.F5910EPP.ERRORRPT.AOUTPUT' HAS AN LRECL OF 133 COULD NOT BE OPENED BECAUSE THE CODED LRECL WAS 80. // DD DSN=F5910&ST&IN..F5910EPP.ERRORRPT.P&CYCDATE, -- DD DSN=F5910PG.F5910EPP.ERRORRPT.P, // DISP=SHR $/ DD DSN=Z1225BT.F5910EPP.ERRORRPT.AOUTPUT please find the error code in the above mentioned lines and please suggest me about the error and the solution for that.

3 Answers   Cognizant,


Categories