View previous topic :: View next topic
|
Author |
Message |
napoleon_cse
New User
Joined: 27 Feb 2006 Posts: 7
|
|
|
|
Using sort, I want to insert date & time in a file which is empty.
Note: My sort step requires only one input file i.e. the empty file..
Can somebody help me by providing the syntax? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Using the empty file as input and output for this kind of thing seems like a silly requirement, but if that's what you really want to do, you can use a DFSORT job like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=userid.file,DISP=SHR
//SORTOUT DD DSN=userid.file,DISP=OLD
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(DATE,TIME)
/*
|
Note that userid.file must have valid attributes (RECFM, LRECL, BLKSIZE). This will give you an output record in userid.file of:
mm/dd/yyhh:mm:ss
You can use different DFSORT parameters to get different formats for the date and time if appropriate. |
|
Back to top |
|
|
napoleon_cse
New User
Joined: 27 Feb 2006 Posts: 7
|
|
|
|
My actual requirement was to edit a file using an IBM utility...
basically the step will have only one file and i'll write some records on it using the utility...
Thanks for the reply...
It would be great if u can tell me any other ways to achieve the requirement... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You need to do a better job of defining your requirements if you want somebody to help you. However, if this is a class assignment, you should really do your own homework. |
|
Back to top |
|
|
|