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

Is it possible to add timestamp in the Header Record?

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


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Thu Jun 16, 2011 2:27 pm    Post subject: Is it possible to add timestamp in the Header Record? Reply with quote

Hi i need to add header and trailer record to a file..
my data file will look like
aaaa
bbbb
ccccc

and my outfile should look like

HDR-Invoice-current timestamp
aaaa
bbbb
cccc
TRL-count

infile & outfile LRECL=80, RECFM = FB

can anyone please help me with a JCL for the above requirement?
_________________
Thanks,
Ganesh.
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
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 16, 2011 9:45 pm    Post subject: Reply with quote

I could have given you a better answer if you had shown exactly what you want the header and trailer to look like including the format of the date and count. But you didn't, so I'll have to guess. You can use a DFSORT job like the following to add a header and trailer:

Code:

//S1 EXEC PGM=SORT                               
//SYSOUT DD SYSOUT=*                             
//SORTIN DD *                                   
aaaa                                             
bbbb                                             
ccccc                                           
//SORTOUT DD SYSOUT=*                           
//SYSIN DD *         
  OPTION COPY                                             
  OUTFIL REMOVECC,                                         
    HEADER1=('HDR-Invoice-',DATE=(4MD/),X,TIME=(24:)),     
    TRAILER1=('TRL-',COUNT=(M11,LENGTH=8))                 


SORTOUT would have:

Code:

HDR-Invoice-2011/06/16 09:44:40     
aaaa                               
bbbb                               
ccccc                               
TRL-00000003                       


If you want something else, tell me EXACTLY what you want.

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:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
_________________
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.
sganesh_85
Member


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Fri Jun 17, 2011 11:12 am    Post subject: Reply with quote

Hi Frank,

Thank a lot!!!
I am really surprised to see this quick reply..

This was my first post in this forum and i am really pleased to see such a quick and relavant solution..

Thanks once again..
_________________
Thanks,
Ganesh.
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: Fri Jun 17, 2011 9:46 pm    Post subject: Reply with quote

Quote:
I am really surprised to see this quick reply.


I monitor this Forum (and DFSORT Forums on several other help boards) all day at work.

Quote:
This was my first post in this forum and i am really pleased to see such a quick and relavant solution.


Glad to help. Next time, give more details of what you want so I don't have to guess.
_________________
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.
sganesh_85
Member


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Tue Jul 19, 2011 3:49 pm    Post subject: Reply with quote

Hi Frank

Again i need your help!!
how to get the timestamp in the format YYYY-MM-DD HH:MI:SS
in header file..

before you suggested me to use

OPTION COPY
OUTFIL REMOVECC,
HEADER1=('HDR-Invoice-',DATE=(4MD/),X,TIME=(24:)),
TRAILER1=('TRL-',COUNT=(M11,LENGTH=Cool)

but now i have to use this timestamp format
_________________
Thanks,
Ganesh.
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 Jul 19, 2011 9:42 pm    Post subject: Reply with quote

The only difference I see is a - instead of / for the date, so you would use:

Code:

  DATE=(4MD-),X,TIME=(24:)


Am I missing something?
_________________
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.
sganesh_85
Member


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Wed Jul 20, 2011 11:25 am    Post subject: Reply with quote

Thank you very much Frank!!

Frank is there a way in sort for my below requirement.

i have a data file with some records.
name of the data file is DBARD.ADSS.EDR.TAB001.D&ODATE

i need to create another file which should have data like
--number of records in data file
--date in YYYY-MM-DD
--name of the data file (ie DBARD.ADSS.EDR.TAB001.D&ODATE)
--and timestamp in YYYY-MM-DD HH:MI:SS format

pls help


--
_________________
Thanks,
Ganesh.
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: Thu Jul 21, 2011 12:28 am    Post subject: Reply with quote

If you can set up the dsname as a SET or PROC symbol, then you can use a DFSORT job like the following:

Code:

// SET DSN1=data_set_name
//S1 EXEC PGM=SORT,PARM='JP1"&DSN1"'
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&DSN1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(COUNT=(M11,LENGTH=8),X,DATE=(4MD-),X,
      JP1,X,DATE=(4MD-),X,TIME=(24:))
/*

_________________
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.
sganesh_85
Member


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Thu Jul 21, 2011 10:19 am    Post subject: Reply with quote

Hi Frank,

you are really Great!!!
the code is working excellent for my requirement.

Thank you very much Frank!!

your response is really quick and accurate!!
_________________
Thanks,
Ganesh.
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.
sganesh_85
Member


Joined: 16 Jun 2011
Posts: 14

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

PostPosted: Mon Jul 25, 2011 3:22 pm    Post subject: Reply with quote

Hi Frank,

i used the below job and created a file

//STEP2 EXEC PGM=SORT,PARM='CTL"DPSIT4B.&MLQ..TAB002.D&ODATE..UNLOAD"'
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN DD DSN=DBRDB.ABPDB.RMS.TAB002.D&ODATE..UNLOAD,DISP=SHR
//SORTOUT DD DSN=&HLQ..&MLQ..TAB002.D&ODATE..CTL,
// SPACE=(CYL,(150,100),RLSE),
// DCB=(LRECL=82,RECFM=FB),
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=10),'|',DATE=(4MD-),'|',
CTL,'|',DATE=(4MD-),X,TIME=(24:))

my output file has the record
0000000009|2011-07-21|DPSIT4B.ABPDB.RMS.TAB002.D110721.UNLOAD|2011-07-21 17:53:47|

but now my requirement has changed and my output file should have data like

9|20110721|DPSIT4B.ABPDB.RMS.TAB002.D110721.UNLOAD|2011-07-21 17:53:47|

if the count is 12345, then the count should have this value.(count can vary from 1 to 10 digits)

and one more difference is the Date without "-", for acheiving this i used below sort card

OPTION COPY
INREC BUILD=(DATE1,TIME1,80:X)
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(2,8,'|')
is there any other way to acheive this date format

Pls help
_________________
Thanks,
Ganesh.
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
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jul 26, 2011 1:21 am    Post subject: Reply with quote

You can't use CTL as the symbol name in PARM. You have to use JPn (e.g. JP1).

Here's a DFSORT/ICETOOL that will do what I think you're asking for:

Code:

//STEP2 EXEC PGM=ICETOOL,
//  PARM='JP1"DPSIT4B.&MLQ..TAB002.D&ODATE..UNLOAD"'
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN   DD DSN=DBRDB.ABPDB.RMS.TAB002.D&ODATE..UNLOAD,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=&HLQ..&MLQ..TAB002.D&ODATE..CTL,
//       SPACE=(CYL,(150,100),RLSE),
//       DCB=(LRECL=82,RECFM=FB),
//       DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    BUILD=(82:X),
    TRAILER1=(COUNT=(M10,LENGTH=10),'|',DATENS=(4MD),'|',
        JP1,'|',DATE=(4MD-),X,TIME=(24:))
//CTL2CNTL DD *
  INREC BUILD=(1,82,JFY=(SHIFT=LEFT))
/*

_________________
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 9: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 Search Batch file-aid help 14 frenchman 31561 Mon Feb 01, 2016 10:23 pm
academyindia4 View latest post
No new posts File-Aid Help 3 Nicholas 21374 Mon Feb 01, 2016 10:22 pm
academyindia4 View latest post
No new posts Hi plz help me out 7 Guest 21197 Mon Feb 01, 2016 10:14 pm
academyindia4 View latest post
No new posts Need urgent HELP 4 Sulagna 12528 Mon Feb 01, 2016 1:39 am
academyindia4 View latest post
This topic is locked: you cannot edit posts or make replies. executing java program thru JCL 6 Guest 24809 Tue Feb 12, 2013 1:56 pm
Anuj Dhawan 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-5842.html