View previous topic :: View next topic
|
Author |
Message |
ralph_v
New User
Joined: 07 Jul 2005 Posts: 27
|
|
|
|
Hi,
Suppose there are 100 lines in a file and i want to delete only the 10th line in that file. Is that possible in JCL.
If yes , how is it possible. |
|
Back to top |
|
|
mainframesguru
New User
Joined: 24 Jun 2005 Posts: 36 Location: Hyderabad
|
|
|
|
Hi
It can be done otherway round.Instead of Deleting, Copy records other
than 10th into other datasets.Check the following procedure.
STEP01: Copy 1-9 records into a temporary file, using IDCAMS REPRO COUNT(9).
STEP02: Copy 11-100 records into a temporary file, using IDCAMS REPRO SKIP(10)
STEP03: Concatenate Temporary files of STEP01 and STEP02 and copy it to Input file.
There can be other solutions to this one.....
Regards,
Vamshi Krishna Indla
Hyderabad |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
go for sort |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
This works with ICETOOL
//ICE1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//REPORT DD SYSOUT=*
//*
//IN001 DD DSN=XXXXX.IN1,
// DISP=SHR
//TOOLIN DD *
COPY FROM(IN001) TO(OUT001) USING(S001)
COPY FROM(IN001) TO(OUT001) USING(S002)
/*
//S001CNTL DD *
SORT FIELDS=COPY,STOPAFT=0000009
//S002CNTL DD *
SORT FIELDS=COPY,SKIPREC=00010
//OUT001 DD DSN=XXXXX.OU1,DISP=MOD |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can do it in one pass with DFSORT as follows. I assumed your input file has RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:SEQNUM,5,ZD)
OUTFIL OMIT=(81,5,ZD,EQ,+10),BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
IQofaGerbil,
When you specify a COPY operator, DFSORT automatically does a copy so you don't need SORT FIELDS=COPY. Your control statements should be:
Code: |
//TOOLIN DD *
COPY FROM(IN001) TO(OUT001) USING(S001)
COPY FROM(IN001) TO(OUT001) USING(S002)
/*
//S001CNTL DD *
OPTION STOPAFT=9
/*
//S002CNTL DD *
OPTION SKIPREC=10
/*
|
|
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Frank,
Thanks, old habits die hard! |
|
Back to top |
|
|
|