MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get PST TSO TIME using CURDAT sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rgcmohan
Beginner


Joined: 30 Jun 2017
Posts: 5
Topics: 3

PostPosted: Fri Oct 13, 2017 12:00 pm    Post subject: How to get PST TSO TIME using CURDAT sort Reply with quote

Hi,

Actually we need to get the PST TSO time
but it picks up my computer system time.

My sort JCL is:
Code:

//S1   EXEC  PGM=SORT     
//SYSOUT DD SYSOUT=*       
//SYMNAMES DD *           
CURDAT,S'&LMON/&DAY/&LYR2'
//SORTIN DD *             
A                         
//SORTOUT DD  SYSOUT=*     
//SYSIN    DD *           
  OPTION COPY             
  INREC BUILD=(X,CURDAT)   

Can you please help to get TSO time ?
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Fri Oct 13, 2017 2:19 pm    Post subject: Reply with quote

Ddfsort will always pickup your Mainframe system time, not your computer time.

Show us the screen shot of JESMSGLG, which displays the Time and date.

give us the output of your code.

Thanks
Magesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Mon Oct 16, 2017 11:58 am    Post subject: Reply with quote

rgcmohan,

Your JCL is getting the current date and not the time. Getting the PST time is not a big deal , however you need to deal with the day light savings time. Right now UTC - 7 hours = PST time, but that would change where your system is running. On the first sunday of november it would be UTC - 8 hours.

so get the UTC time using the dynamic system symbol &HHMMSS and then convert that into seconds and subtract 7 or 8 hours depending on when you are running. This will give you the PST time in seconds and then you can convert this back to time format.

Here is an untested jcl

Code:

//   SET OFFSET='7'                                           
//STEP0100 EXEC PGM=SORT,PARM='JP1"&OFFSET"'                 
//SYSOUT   DD SYSOUT=*                                       
//SYMNAMES DD *                                               
CURDATE,S'&LMON/&DAY/&LYR2'                                   
CURTIME,S'&HHMMSS'                                           
//SORTIN   DD *                                               
A                                                             
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  OPTION COPY                                                 
  INREC BUILD=(CURDATE,18:CURTIME,25:JP1)
                   
  OUTREC IFOUTLEN=17,IFTHEN=(WHEN=INIT,                       
  OVERLAY=(30:(18,2,ZD,MUL,+3600),ADD,                       
              (20,2,ZD,MUL,+0060),ADD,                       
              (22,2,ZD),SUB,                                 
              (25,1,UFF,MUL,+3600),M11,LENGTH=8,             

           10:30,8,ZD,DIV,+3600,EDIT=(TT),C':',               
             (30,8,ZD,MOD,+3600),DIV,+60,EDIT=(TT),C':',     
            ((30,8,ZD,MOD,+3600),MOD,+60),EDIT=(TT)))         
//*                                                           

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Suchay
Beginner


Joined: 29 Jun 2017
Posts: 43
Topics: 9

PostPosted: Tue Oct 17, 2017 10:19 am    Post subject: Reply with quote

Magesh,

Quote:

Ddfsort will always pickup your Mainframe system time, not your computer time.

Show us the screen shot of JESMSGLG, which displays the Time and date.

give us the output of your code.


Here you go

Code:

 SDSF OUTPUT DISPLAY XXXXXXX JOB14039  DSID     2 LINE 0   COLUMN
 COMMAND INPUT ===>                                            SCROLL
********************************* TOP OF DATA ************************
                    J E S 2  J O B  L O G  --  S Y S T E M  N M A 1  -
                                                                     
21.32.39 JOB14039 ---- MONDAY,    16 OCT 2017 ----                   
21.32.39 JOB14039  IRR010I  USERID XXXXXXX IS ASSIGNED TO THIS JOB.     



Symnames output

Code:

SDSF OUTPUT DISPLAY xxxxxx JOB14039  DSID   106 LINE 0
COMMAND INPUT ===>                                       
******************************** TOP OF DATA ************
****** SYMNAMES SYMBOL STATEMENTS ******                 
CURDAT,S'&LMON/&DAY/&LYR2'                               
********** SYMBOL DEFINITIONS **********                 
CURDAT,C'10/17/17'                                       
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Tue Oct 17, 2017 10:29 am    Post subject: Reply with quote

Suchay,


So rgcmohan is your other id? Why do you need 2 different ids? Both ids will be deleted if you continue this.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Suchay
Beginner


Joined: 29 Jun 2017
Posts: 43
Topics: 9

PostPosted: Tue Oct 17, 2017 11:18 am    Post subject: Reply with quote

We are coworkers
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Oct 18, 2017 1:27 pm    Post subject: Reply with quote

Interesting..

Kolusu,

Please advise what date &DAY refer to ?

Also what is difference between &LMON and &MON ?

Thanks
Magesh
Back to top
View user's profile Send private message
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Oct 18, 2017 4:06 pm    Post subject: Reply with quote

Google is your best friend.
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.ieae200/dynpsm.htm
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Oct 18, 2017 5:39 pm    Post subject: Reply with quote

Thanks Nascar9

Suchay,

Try using &LDAY instead of &DAY

Regards
Magesh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group