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
 

 

Date-TimeStamp in Outputfile

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

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Mon Jul 09, 2012 8:54 pm    Post subject: Date-TimeStamp in Outputfile
Reply with quote

Hello,

I have no input file, I just want to run a sort job and write current timestamp in my outputfile.

I know itcan be done through below Sort :-
Code:

OPTION COPY
INREC OVERLAY(1:DATE=(4MD-),C'-',TIME(24.))


Output will be :-
Code:

2012-07-09-10.44.40


I do not know how to get this done without having any input file.
Please help
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Jul 09, 2012 8:58 pm    Post subject:
Reply with quote

Have an input file:

Code:
//SORTIN DD *
anything you want, I usually put "CONTENT IRRELEVANT" or something to make it obvious.
Back to top
View user's profile Send private message
Prakash J

New User


Joined: 23 May 2012
Posts: 14
Location: India

PostPosted: Mon Jul 09, 2012 9:02 pm    Post subject: Reply to: Date-TimeStamp in Outputfile
Reply with quote

Hi,

I think, you can use specify the input file like his:

//SORTIN DD *

/*

I din't test this. Please let me know if it works.

-Prakash
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Mon Jul 09, 2012 9:04 pm    Post subject:
Reply with quote

Hi Bill, the problem is at our shop we use standardised Procedures for executing Sorts.
So from job we pass input and output files, datacards with SORT commands etc.
So in my procedure, it is something like this -
Code:

//STEP01 EXEC PGM=SORT
//SYSIN DD DSN=&&CARD01,DISP=(OLD,DELETE,DELETE)
//SORTIN DD DSN=&&INFILE,DISP=SHR,
//SORTOUT DD DSN=&&OUTFILE,DISP=(NEW,CATLG,DELETE)
//SYSOUT DD SYSOUT=*


We are asked to use this standardised procedure, that is why I cannot go ahead with the suggestion that you have provided
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Jul 09, 2012 9:10 pm    Post subject:
Reply with quote

I was only suggesting DD * to illustrate the example. In production I'd always expect the SORTIN and the SYSIN and SYMNAMES etc to be datasets. So, put the "line" in a dataset.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Mon Jul 09, 2012 9:18 pm    Post subject:
Reply with quote

@Bill
Yes this is for production and we cannot have any empty or dummy dataset to be created for this requirement.
I tried passing DSN1=NULLFILE from the job, but it gives error -->
INVALID DATASET ATTRIBUTES : SORTIN RECFM REASON CODE IS 10

Any suggestions ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jul 09, 2012 9:34 pm    Post subject:
Reply with quote

techslam,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=NULLFILE,DISP=SHR,LRECL=80,RECFM=FB   
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  OUTFIL REMOVECC,NODETAIL,                             
  HEADER1=(DATE=(4MD-),C'-',TIME(24.))                 
//*
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Jul 09, 2012 9:37 pm    Post subject:
Reply with quote

Well, there we go. I'm not thinking laterally enough. HEADER/TRAILER exist whether zero or a scrillion records.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Mon Jul 09, 2012 10:25 pm    Post subject:
Reply with quote

@Skolusu... Thanks a lot. You are a life saviour icon_smile.gif
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 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 Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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