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
 

 

TIMESTAMP using DFSORT

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

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Wed Dec 03, 2008 11:33 am    Post subject: TIMESTAMP using DFSORT
Reply with quote

Hi,

I have a requirement to insert TIMESTAMP dynamically. Can we do this using SORT?

I have searched the forum and found the below card

Code:

OUTREC FIELDS=(1,9,10:DATE4,C'.000000')


I am using for the time being this card. But can we produce TIMESTAMP with micro seconds part also dynamically? My requirement is to get total TIMESTAMP as below.
YYYY-MM-DD-hh.mm.ss.nnnnnn
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Dec 03, 2008 10:40 pm    Post subject:
Reply with quote

DFSORT does NOT have any built-in functions for getting the microsecond part dynamically.
Back to top
View user's profile Send private message
ganeshcet

New User


Joined: 25 Jan 2007
Posts: 11
Location: New York

PostPosted: Fri Dec 19, 2008 9:28 am    Post subject:
Reply with quote

Is there a utility that creates Timestamp into a file ?

I would like to have a sort/step which creates a Fixed LRECL file with time stamp alone (micro seconds can be 0)

Only option which i m using is sort

Code:

//EXEC1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE1===>BOTH SAME,DISP=SHR
//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1:DATE4,C'.000000')


Note: file1 should have a single record !
Is there an utility which creates the file with timestamp only ?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Dec 19, 2008 9:47 am    Post subject:
Reply with quote

Hello,

Quote:
Is there a utility that creates Timestamp into a file ?
Not that i'm aware of, but you could write your own in very few lines of code. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2233
Location: @my desk

PostPosted: Fri Dec 19, 2008 10:06 am    Post subject:
Reply with quote

Quote:
micro seconds can be 0
If you are OK with the microsecond part, what is wrong in the current DFSORT approach?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 19, 2008 9:13 pm    Post subject:
Reply with quote

ganeshcet,

Assuming FILE1 has RECFM=FB, you can use a DFSORT job like the following to do what you asked for. Just replace n with the LRECL of FILE1 (e.g. if FILE1 has LRECL=80, replace n with 80).

Code:

//EXEC1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=FILE1,DISP=OLD
//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC BUILD=(1:DATE4,C'.000000',n:X)
/*
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Tue Nov 10, 2009 9:18 am    Post subject: Reply to: TIMESTAMP using DFSORT
Reply with quote

Hi Frank,

I just want to bring this topic up again. If DFSORT can't get the microsecond dynamically? Does any other tool can?

Thanks!
Back to top
View user's profile Send private message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Tue Nov 10, 2009 1:14 pm    Post subject:
Reply with quote

Hi Mumblez,

If your system supports DB2, then you get the microsecond from the timestamp.
This can be accomplished using SYSIBM.* tables and using IKJEFT in JCL misrosecond can be written to a file.

Please refer to the link:- http://www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html?S_TACT=105AGX01&S_CMP=TOPTEN

Thanks.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Nov 10, 2009 1:37 pm    Post subject:
Reply with quote

Hi,

what about REXX,

Code:
TIME = TIME('L')             /* HH:MM:SS.UUUUUU */


Quote:
Long returns time in the format: hh:mm:ss.uuuuuu (uuuuuu is the
fraction of seconds, in microseconds). The first eight
characters of the result follow the same rules as for the Normal
form, and the fractional part is always six digits.


Gerry
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Wed Nov 11, 2009 2:33 pm    Post subject: Reply to: TIMESTAMP using DFSORT
Reply with quote

Thanks gcicchet,

I'm not that really familiar with REXX, and I tried reading a few REXX stuff. How do you write REXX displays into a Dataset?
I tried the simple command:
/* REXX */
SAY 'TEST'
But I can't find the display output anywhere.Should it be in the SYSTSPRT, SYSPRINT, SYSOUT or OUTDD?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Nov 11, 2009 2:49 pm    Post subject: Reply to: TIMESTAMP using DFSORT
Reply with quote

here is a jcl snippet ( modify according to Your needs )
jcl stream not tested ... but no reason it should not work icon_biggrin.gif

Code:

// ...   JOB   ...
//* CREATE THE PDS CONTAINING THE REXX SCRIPT
//IEB1    EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD DUMMY
//SYSUT1    DD *
/* REXX */
timec.0 = 1
timec.1 = time("L")

do i = 1 to timec.0
    say ">"timec.i"<"
end

Address TSO "EXECIO" timec.0 "DISKW SYSUT2 (STEM TIMEC. FINIS"
exit
/*
//SYSUT2    DD DISP=(NEW,PASS),
//             DSN=&&SCRIPT(TIMEC),
//             UNIT=SYSDA,SPACE=(TRK,(1,1,1))
//             DCB=(RECFM=FB,LRECL=80)
//*
//* RUN THE REXX SCRIPT TO WRITE TIME CARD
//IKJ     EXEC PGM=IKJEFT01
//SYSPROC   DD DISP=(OLD,PASS),
//             DSN=&&SCRIPT
//SYSPRINT  DD SYSOUT=*
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
  TIMEC
//SYSUT2    DD DISP=(NEW,PASS),
//             DSN=&&TIMEC,
//             UNIT=SYSDA,SPACE=(TRK,(1,1))
//             DCB=(RECFM=FB,LRECL=80)
//*
//*
//* SEE THAT THE REXX SCRIPT PRODUCED THE RIGHT TIME CARD
//IEB2    EXEC PGM=IEBGENER
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD DUMMY
//SYSUT1    DD DISP=(OLD,PASS),
//             DSN=&&TIMEC
//SYSUT2    DD SYSOUT=*
//*
Back to top
View user's profile Send private message
Mumblez

New User


Joined: 27 Apr 2007
Posts: 7
Location: Philippines

PostPosted: Mon Nov 16, 2009 7:33 am    Post subject:
Reply with quote

Thanks Enrico,

But the first step IEB1 doesn't work, SYSUT2 has no data for TIMEC when i tried to execute it.

Also, when i tried to store the display to a dataset, it has 'START' and 'END', is there a command to omit them?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Mon Nov 16, 2009 2:24 pm    Post subject: Reply to: TIMESTAMP using DFSORT
Reply with quote

my bad... I forgot about the rexx comment statement

change
Code:
//SYSUT1    DD *

to
Code:
//SYSUT1    DD *,DLM=$$

after the rexx exit statement
change
Code:
/*

to
Code:
$$
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
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 DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm


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