Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how can skip last record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
naveeneckumar

New User


Joined: 11 Jan 2008
Posts: 5
Location: india

PostPosted: Thu Jan 17, 2008 4:50 pm    Post subject: how can skip last record
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jan 17, 2008 10:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
naveeneckumar

New User


Joined: 11 Jan 2008
Posts: 5
Location: india

PostPosted: Fri Jan 18, 2008 9:22 am    Post subject:
Reply with quote

thanks a lot
Back to top
View user's profile Send private message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Mon Jan 21, 2008 1:17 pm    Post subject: Reply to: how can skip last record
Reply with quote

Pls explain the use of TRAILER1 here.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 21, 2008 2:04 pm    Post subject:
Reply with quote

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

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Mon Jan 21, 2008 2:49 pm    Post subject: Reply to: how can skip last record
Reply with quote

Thanks. Is that possible to add sort condition also here??
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 21, 2008 2:59 pm    Post subject: Re: Reply to: how can skip last record
Reply with quote

Prabha wrote:
Thanks. Is that possible to add sort condition also here??
Please be clear!!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 21, 2008 9:24 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 27, 2008 11:32 pm    Post subject:
Reply with quote

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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us