how to get the last 500 records from tape file.



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

how to get the last 500 records from tape file.

Postby leon » Thu Dec 11, 2008 2:22 am

hi, there
I have a tape file(MP.PMPYCRH0.KEEP2005), I need to check the last 500 records. so I want move it to disk.
how to modify my following JCL to meet the requirment? thx.

//TAPECOPA JOB (31490),'DDE',                   
//         CLASS=T,MSGCLASS=X,                 
//         REGION=8M                           
//*                                             
/*JOBPARM ROOM=1107,LINES=999,TIME=9,COPIES=1   
//*---------------------------------------------
//*                DELETE STEP                 
//*---------------------------------------------
//SCRATCH  EXEC PGM=IDCAMS                     
//SYSPRINT DD SYSOUT=*                         
//SYSIN    DD *                                 
      DELETE ('MP.UMP8CSMW.LIAN')               
/*                                             
//STEP1  EXEC  PGM=IEBGENER                     
//SYSPRINT DD  SYSOUT=*                         
//*----------------------------------------------   
//*                TAPE FILE                       
//*----------------------------------------------   
//SYSUT1 DD DSN=MP.PMPYCRH0.KEEP2005,               
//*         VOL=SER=(3T1276),                       
//          UNIT=TAPE,DISP=OLD                     
//*----------------------------------------------   
//*                DISK FILE                       
//*----------------------------------------------   
//SYSUT2 DD DSN=MP.UMP8CSMW.Leon,                   
//             UNIT=SYSDA,                         
//*            UNIT=TAPE,                           
//             DISP=(NEW,CATLG,CATLG),             
//             SPACE=(CYL,(500,200),RLSE)           
//*                                                 
//SYSIN    DD  DUMMY                               
/*                                                 
//                                                 

leon
 
Posts: 40
Joined: Tue Nov 25, 2008 7:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to get the last 500 records from tape file.

Postby dick scherrer » Thu Dec 11, 2008 3:07 am

Hello,

First, run a count of all of the records on the file.

Second, skip the total count minus 500 and copy those records to a dasd file for further use.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: how to get the last 500 records from tape file.

Postby Frank Yaeger » Thu Dec 11, 2008 3:47 am

You can use the SUBSET function of DFSORT's ICETOOL to do this quite easily as shown below. You'll need z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that DFSORT PTF, ask your System Programmer to install it (it's free).

//S1    EXEC  PGM=ICETOOL                                   
//TOOLMSG   DD  SYSOUT=*                                   
//DFSMSG    DD  SYSOUT=*                                   
//IN DD DSN=...   input file                           
//OUT DD DSN=...  output file                                 
//TOOLIN DD *                                               
SUBSET FROM(IN) TO(OUT) KEEP INPUT LAST(500)               
/*


For complete details on the new SUBSET function and the other new DFSORT/ICETOOL functions available with PTF UK90013, see:

http://www.ibm.com/systems/support/stor ... /mvs/ugpf/
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post