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 to remove the trailer record from the File

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Nov 27, 2007 12:29 pm    Post subject: How to remove the trailer record from the File
Reply with quote

Hi,

I have a quick query regarding the removal of a trailer record from a file.

The structure of the trailer record is not fixed. At the end of the file they are forcefully inserting

the trailer record with the record count and with the text 'rows selected'

Ex: 122394 rows selected

I am able to remove the trailer can use the INCLUDE COND=(???,13,CH,EQ,C'rows selected').

But when the record count changes the starting position of the text 'rows selected' will be changed

automatically.

In this case is there any command to remove the trialer record from the file.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 12:39 pm    Post subject:
Reply with quote

mkk,

Try this -

Code:
//S1     EXEC PGM=SORT                             
//SYSOUT DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                             
//SORTIN DD *                                     
1 ROWS SELECTED                                   
1000 ROWS SELECTED                                 
200000 ROWS SELECTED                               
DUMMY RECORD                                       
/*                                                 
//SORTOUT DD SYSOUT=*                             
//SYSIN  DD *                                     
  OPTION COPY                                     
  INCLUDE COND=(1,80,SS,NE,C'ROWS SELECTED')       
/*                                                 
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Nov 27, 2007 1:41 pm    Post subject:
Reply with quote

Murali,

the sort card that you gave here is working fine. But In the worst case scenario, If the actual records contains the string 'rows selected' then those records are also removing in addition to the trailer record.

Here I need to point only the trailer record that is the last record in the file.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 2:59 pm    Post subject:
Reply with quote

M K K,

Quote:
But In the worst case scenario, If the actual records contains the string 'rows selected' then those records are also removing in addition to the trailer record.


Follwoing is one of the the today's post. Might be you can use 'the jcl' and develop your own sort card -

http://ibmmainframes.com/viewtopic.php?t=26249
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: Tue Nov 27, 2007 11:04 pm    Post subject:
Reply with quote

M K K,

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=T1,OVERLAY=(81:SEQNUM,8,ZD)
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
    TRAILER1=('LASTREC,+',COUNT=(M11,LENGTH=8),80:X)
//S2  EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  SORT FIELDS=COPY
  OUTFIL FNAMES=OUT,
    OMIT=(81,8,ZD,EQ,LASTREC),
    BUILD=(1,80)
/*
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Nov 29, 2007 11:32 am    Post subject:
Reply with quote

Thanks Frank. Its working fine.
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: Tue Sep 02, 2008 11:29 pm    Post subject:
Reply with quote

You can now 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 DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT REMOVE LAST
/*


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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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