View previous topic :: View next topic
|
Author |
Message |
naveeneckumar
New User
Joined: 11 Jan 2008 Posts: 5 Location: india
|
|
|
|
is that possible, i skip last record from a file
and copy rest of record in new file
with the use of JCL only
if record count is not specify |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=CTL2CNTL,REMOVECC,NODETAIL,
BUILD=(80X),
TRAILER1=(' OPTION STOPAFT=',COUNT-1=(M11,LENGTH=8))
/*
|
|
|
Back to top |
|
|
naveeneckumar
New User
Joined: 11 Jan 2008 Posts: 5 Location: india
|
|
|
|
thanks a lot |
|
Back to top |
|
|
Prabha Warnings : 2 New User
Joined: 05 Dec 2005 Posts: 79
|
|
|
|
Pls explain the use of TRAILER1 here. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Code: |
TRAILER1=(' OPTION STOPAFT=',COUNT-1=(M11,LENGTH=8))
|
TRAILER1 builds a record with the count-1(total count of records - 1) at the last page of the report(however here we have mentioned NODETAIL, so TRAILER1 would be the only line on the o/p in this case). Finally TRAILER1 is building a control card CTL2CNTL.
To understand the working of TRAILER1 just try executing this
Code: |
//****************************************
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ASDF
qwer
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(' OPTION STOPAFT=',COUNT-1=(M11,LENGTH=8)) |
Also look at "Display the number of input or output records" here
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
Prabha Warnings : 2 New User
Joined: 05 Dec 2005 Posts: 79
|
|
|
|
Thanks. Is that possible to add sort condition also here?? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Prabha wrote: |
Thanks. Is that possible to add sort condition also here?? |
Please be clear!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Is that possible to add sort condition also here?? |
It's not clear what you mean by this. What do you want to do exactly? Please be more specific.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can do this kind of thing quite easily using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008):
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DISP=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT REMOVE LAST
/*
|
The above job removes the last input record. If you want to sort the records and remove the last sorted record, you can use a DFSORT/ICETOOL job like this:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DISP=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) OUTPUT REMOVE LAST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,10,CH,A)
/*
|
For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|