Page 1 of 1

Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 9:04 pm
by newbee77
I am trying to run this JCL to convert a tape format dataset to a disk format dataset, however as the source dataset is too big, i want to convert only the first 500 into DISK
I run into a JCL error when i run it.
Any anyone help please ...

Here is the JCL

000100 // NEWBEE77 JOB (2533,010),'JOBSORT1',CLASS=6,MSGCLASS=X,
000200 // NOTIFY=&SYSUID
000300 //*==================================================================*
000400 //STEP001 EXEC PGM=ICETOOL
000500 //INFILE DD DSN=TAPE.SOURCE.IN.DATASET(0),
000600 // DISP=SHR
000700 //OUTFILE DD DSN=DISC.TARGET.OUT.DATASET,
000800 // DISP=(,CATLG,DELETE),
000900 // SPACE=(CYL,(1000,1000),RLSE),
001000 // DCB=*.INFILE
001100 //SYSOUT DD SYSOUT=*
001200 //TOOLMSG DD SYSOUT=*
001300 //DFSMSG DD SYSOUT=*
001400 //*
001500 //TOOLIN DD *
001600 SORT FROM(INFILE) TO(OUTFILE) USING(CTL1)
001700 /*
001800 //CTL1CNTL DD *
001900 SORT FIELDS=COPY,STOPAFT=1000000
002000 /*
002100 //*

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 9:22 pm
by newbee77
quick correction, the input dataset is not a GDG, so changed line 000500

000100 // NEWBEE77 JOB (2533,010),'JOBSORT1',CLASS=6,MSGCLASS=X,
000200 // NOTIFY=&SYSUID
000300 //*==================================================================*
000400 //STEP001 EXEC PGM=ICETOOL
000500 //INFILE DD DSN=TAPE.SOURCE.IN.DATASET,
000600 // DISP=SHR
000700 //OUTFILE DD DSN=DISC.TARGET.OUT.DATASET,
000800 // DISP=(,CATLG,DELETE),
000900 // SPACE=(CYL,(1000,1000),RLSE),
001000 // DCB=*.INFILE
001100 //SYSOUT DD SYSOUT=*
001200 //TOOLMSG DD SYSOUT=*
001300 //DFSMSG DD SYSOUT=*
001400 //*
001500 //TOOLIN DD *
001600 SORT FROM(INFILE) TO(OUTFILE) USING(CTL1)
001700 /*
001800 //CTL1CNTL DD *
001900 SORT FIELDS=COPY,STOPAFT=1000000
002000 /*
002100 //*

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 9:25 pm
by enrico-sorichetti
nobody will help unless You tell what error You received :evil:

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 9:45 pm
by newbee77
Ofcourse ... i am getting an abend CC0016

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 9:50 pm
by sergeyken
newbee77 wrote:Ofcourse ... i am getting an abend CC0016

Abend U0016 resulted from an ICETOOL/SORT error message which explained the reason of failure.

Either you need to read this message in English, and understand the reason by yourself, or you need to copy this message to this forum.

No other option is available.

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Thu Apr 09, 2020 10:28 pm
by steve-myers
  • DCB=*.DD only works if a DCB is explicitly declared in the referenced DD statement. I think your intent is to pick up the DCB attributes of the data set referenced by the DD statement. In the abstract this is a good idea, but your method is incorrect and also unnecessary as I believe the sort program will automatically do this. The correct way to do this is to specify DCB=disk-data set. DCB=tape-data set will not work.
  • It appears your SORT control statements start in column 1. The SORT operation must start in column 2 or higher.

Re: Convert Tape to Disk to get first 500 records only

PostPosted: Fri Apr 10, 2020 12:48 am
by NicC
i am getting an abend CC0016

That is not an abend - that is a simple completion code.
If you only want 500 records why stop after 100000?
Why use ICETOOL? A simple SORT operation will do what you say you want. Did you consult the manual?

 SORT FIELDS=COPY,STOPAFT=500