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

Header and Trailer in JCL

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


Joined: 01 Jul 2015
Posts: 3

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

PostPosted: Wed Jul 01, 2015 1:28 pm    Post subject: Header and Trailer in JCL Reply with quote

I need a header and trailer to look like the following

Header :

0000000000 XXXX YYYYMMDD HH:MM:SS

Trailer :

9999999999 00000009 YYYYMMDD

The '00000009' is record count.

I have tried numerous ways but can't seem to get it exactly like this.

Any ideas?
_________________
S Harvey
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.

William Collins
Active Member


Joined: 24 May 2012
Posts: 714

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

PostPosted: Wed Jul 01, 2015 5:34 pm    Post subject: Reply with quote

Using HEADER1 and TRAILER1 on OUTFIL are obvious choices. What problem is this giving you?
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.
sharvey123
Member


Joined: 01 Jul 2015
Posts: 3

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

PostPosted: Wed Jul 01, 2015 6:57 pm    Post subject: Reply with quote

William Collins wrote:
Using HEADER1 and TRAILER1 on OUTFIL are obvious choices. What problem is this giving you?


This is my JCL.

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=(BATCHFILE),
// DISP=SHR
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
OPTION COPY,STOPAFT=1
OUTREC OVERLAY=(10:DATE1)
OUTFIL OUTREC=(C'BNO,C''',1,8,C'''',/,
C'CDATE,C''',12,8,C'''',80:X)
/*
//STEP0200 EXEC PGM=SORT
//SYMNAMES DD DSN=&T1,DISP=OLD
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=(FILECOUNTED),
// DISP=SHR
//SORTOUT DD DSN=(OUTPUTFILE),
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=VPDCTINY,
// DCB=(LRECL=147,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(01,20,CH,A)
OUTFIL REMOVECC,
HEADER1=(01:C'0000000000',
20:CDATE,
30:TIME,
40:BNO),
TRAILER1=(01:C'9999999999',
30:COUNT+2=(M11,LENGTH=8))
/*

The only problem is it provides me with a YYMMDD format, I need it as YYYYMMDD.
_________________
S Harvey
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.
William Collins
Active Member


Joined: 24 May 2012
Posts: 714

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

PostPosted: Wed Jul 01, 2015 8:17 pm    Post subject: Reply with quote

Have a look at this bit: C'CDATE,C''',12,8,C'''',80:X). Change that to: C'CDATE,C''',10,8,C'''',80:X).

If you have trouble understanding some SORT control-statements, just break them down. For instance, comment out the entire OUTFIL and you should see the YYYYMMDD at position 10.


Last edited by William Collins on Thu Jul 02, 2015 4:10 pm; edited 1 time in total
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.
sharvey123
Member


Joined: 01 Jul 2015
Posts: 3

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

PostPosted: Thu Jul 02, 2015 1:19 pm    Post subject: Reply with quote

Thank you! Works now Smile
_________________
S Harvey
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.
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 To delete the Trailer REcord from the file 5 mkk157 11110 Mon Jan 25, 2016 10:59 pm
academyindia4 View latest post
No new posts syncsort record count 2 valis 11696 Mon Jul 19, 2010 6:15 pm
mouse13 View latest post
No new posts how to update a record in a file using easytrieve 2 Malini 8729 Fri Jan 23, 2009 12:10 pm
bata42 View latest post
No new posts How to find out the record length using tso command? 4 bsriram 17402 Fri Oct 26, 2007 12:17 am
varun View latest post
No new posts removing the duplicate record and picking up the last entery 2 pinaki_atha 7673 Fri Nov 10, 2006 3:18 am
Frank Yaeger 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-7893.html