Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

To delete the Trailer REcord from the file

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
mkk157
Member


Joined: 07 Feb 2007
Posts: 37
Location: Hyderabad

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 27, 2007 2:28 pm    Post subject: To delete the Trailer REcord from the file Reply with quote

Dear Experts,

My requirement is to delete the trailer record from the Input file and keep all the records as it is.

The format of the Trailer record:

1000 rows selected.
12345 rows selected.
123456 rows selected.

for this requirement, I am able to remove the trailer record with the SORT card,

SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,
INCLUDE=(1,80,SS,NE,C'ROWS SELECTED')


but In the worst case, If any of the actual records contains the string 'rows selected' then they are also getting removed in addition to the trailer record.

Is there any command to point the Trailer record / Last record while using this sort card.
_________________
Kumar
If u can dream it, U can do it.
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 27, 2007 9:31 pm    Post subject: Reply with quote

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,PD)                       
  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)                               
//SORTOUT1 DD DSN=...  output file (FB/80)                                             
//SYSIN    DD    *                                                 
  SORT FIELDS=COPY                                                 
  OUTFIL FNAMES=SORTOUT1,                                         
    OMIT=(81,8,PD,EQ,LASTREC),                                     
    BUILD=(1,80)                                                   
/*

_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Nanda Kishore
Member


Joined: 10 Dec 2007
Posts: 5

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Dec 18, 2007 5:26 pm    Post subject: Reply with quote

Dear Frank,

I check the above jcl.Its great.
I am very curious to know the syntax.Can you please explain

Code:

//SYSIN    DD    *                                                 
  OPTION COPY                                                     
  OUTFIL FNAMES=T1,OVERLAY=(81:SEQNUM,8,PD)                       
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,                             
    TRAILER1=('LASTREC,+',COUNT=(M11,LENGTH=8),80:X)               
/*

//SYSIN    DD    *                                                 
  SORT FIELDS=COPY                                                 
  OUTFIL FNAMES=SORTOUT1,                                         
    OMIT=(81,8,PD,EQ,LASTREC),                                     
    BUILD=(1,80)                                                   
/*
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Dec 18, 2007 9:44 pm    Post subject: Reply with quote

Code:

  OUTFIL FNAMES=T1,OVERLAY=(81:SEQNUM,8,PD)                       


Adds a sequence number to the end of each input record to create the T1 records.

Code:

  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,                             
    TRAILER1=('LASTREC,+',COUNT=(M11,LENGTH=8),80:X)               


Creates a DFSORT Symbol like this:

LASTREC,+dddddddd

where dddddddd is the count of the input records = the sequence number for the last record.

Code:
                                   
  OUTFIL FNAMES=SORTOUT1,                                         
    OMIT=(81,8,PD,EQ,LASTREC),                                     
    BUILD=(1,80)                                     


The OMIT operand uses the LASTREC symbol to omit the last T1 record (remember that T1 has each input record with a sequence number at the end of it).

The BUILD operand removes the sequence number.

Does that help?
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jul 30, 2008 1:29 am    Post subject: Reply with quote

You can remove the last record quite easily without worrying about the RECFM or LRECL 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
/*


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/
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 10:59 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Getting no of records in a file 13 Rajapriyaa 14579 Wed Feb 03, 2016 12:44 am
academyindia4 View latest post
No new posts Replacing characters Using JCL 7 rachitsethcse 13826 Wed Feb 03, 2016 12:41 am
academyindia4 View latest post
No new posts Getting Error while using ICEMAN tool 6 giri211 13152 Wed Feb 03, 2016 12:40 am
academyindia4 View latest post
No new posts Calling COBOL from C - getting SOC1 2 balajiiinx 9048 Mon Feb 01, 2016 1:26 am
academyindia4 View latest post
No new posts Easytrieve program for getting Recound counts. 1 prakash.subramaniam 7197 Mon Oct 05, 2009 5:09 pm
Natarajan View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3167.html