View previous topic :: View next topic |
Author |
Message |
sub Beginner
Joined: 30 Jan 2007 Posts: 20 Topics: 12
|
Posted: Fri Dec 11, 2009 12:41 pm Post subject: Extract last record only |
|
|
Hi,
I want to extract the first record and last record into a output dataset from a VBS input file. I can use STOPAFT=1 for extracting the first record. But I am not sure how to extract the last record only.
Can you please tell me how to extract only the last record from a VBS file using DFSORT.
Thanks,
sub |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Dec 11, 2009 12:55 pm Post subject: |
|
|
You can use a DFSORT/ICETOOL job like the following:
Code: |
//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 FIRST LAST
/*
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
sub Beginner
Joined: 30 Jan 2007 Posts: 20 Topics: 12
|
Posted: Fri Dec 11, 2009 1:11 pm Post subject: |
|
|
Thanks Frank. It works for me. |
|
Back to top |
|
 |
|
|