View previous topic :: View next topic
|
Author |
Message |
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have an input file:
Code: |
//SORTIN DD *
anything you want, I usually put "CONTENT IRRELEVANT" or something to make it obvious. |
|
|
Back to top |
|
|
Prakash J
New User
Joined: 23 May 2012 Posts: 14 Location: India
|
|
|
|
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 |
|
|
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
@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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, there we go. I'm not thinking laterally enough. HEADER/TRAILER exist whether zero or a scrillion records. |
|
Back to top |
|
|
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
@Skolusu... Thanks a lot. You are a life saviour |
|
Back to top |
|
|
|