IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date-TimeStamp in Outputfile


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 09, 2012 8:58 pm
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 09, 2012 9:10 pm
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 09, 2012 9:37 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top