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

is there a way to print time in HH:MM only?


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 12:04 am
Reply with quote

hello,
I am trying to print the time of the process only as HH:MM.
every reference in the manual I found include HH:MM:SS at least.
I need to include the time in HH:MM format in a header for a file.

Is there a way to do it?

thanks
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 12:18 am
Reply with quote

I found several time related formats on table 35 Run-time constants on Page 2-167 on manual
however, none of them is what I am looking for.
is there a way to get the time in a desired format (HH:MM)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 05, 2022 1:34 am
Reply with quote

Code:
 ... &TIME2(:) ...
===> С'hh:mm'


Code:
 ... &TIME ...
===> С'hh:mm:ss'


Code:
 ... &TIME1(-) ...
===> С'hh-mm-ss'


Code:
&TIME      C'hh:mm:ss' 8
&TIME1     C'hhmmss'   6
&TIME1(c)  C'hhcmmcss' 8
&TIME1P    P'hhmmss'   4
&TIME2     C'hhmm'     4
&TIME2(c)  C'hhcmm'    5
&TIME2P    P'hhmm'     3
&TIME3     C'hh'       2
&TIME3P    P'hh'       2
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 6:36 pm
Reply with quote

thank you Sergeyken
I wish this was more straighforward:
Syncsort didn't like the fix:
I executed the code with the standard &date and &time
worked fine.
then I executed again with the suggested &time2 and that upset the &date parm.
trying to figure out what is wrong now
Code:
SYSIN :                                                       
  DEBUG NOABEND                                               
  OMIT COND=((01,8,EQ,C'PROCESS '),OR,(1,07,EQ,C'SYSPLEX')),FO
  SORT FIELDS=(1,335,A),FORMAT=CH                             
  SUM FIELDS=NONE                                             
  OUTFIL REMOVECC,                                           
    HEADER1=(01:'PROCESS STARTED AT ',                       
             20:&DATE(MD4/),                                 
                           *                                 
             31:&TIME2(:),/,                                 
             01:'SYSPLEX|RESOURCE TYPE|RESOURCE',             
             31:'|GROUP/ID|ACCESS ID|ACCESS|'),               
    TRAILER1=(01:'PROCESS COMPLETED AT ',                     
              22:&DATE(MD4/),33:&TIME)                       
    OUTREC IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,NE,C'*'),
    OVERLAY=(276:C'USER |',293,8,C'           ')),           
    IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,EQ,C'*'),       
    OVERLAY=(276:C'USER |',293,7,C'            '))           
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR 
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 6:40 pm
Reply with quote

it doesn't even like the straight &time2 (without (icon_smile.gif )as shown in manual
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 05, 2022 7:01 pm
Reply with quote

migusd wrote:

trying to figure out what is wrong now
Code:
SYSIN :                                                       
  DEBUG NOABEND                                               
  OMIT COND=((01,8,EQ,C'PROCESS '),OR,(1,07,EQ,C'SYSPLEX')),FO
  SORT FIELDS=(1,335,A),FORMAT=CH                             
  SUM FIELDS=NONE                                             
  OUTFIL REMOVECC,                                           
    HEADER1=(01:'PROCESS STARTED AT ',                       
             20:&DATE(MD4/),                                 
                           *                                 
             31:&TIME2(:),/,                                 
             01:'SYSPLEX|RESOURCE TYPE|RESOURCE',             
             31:'|GROUP/ID|ACCESS ID|ACCESS|'),               
    TRAILER1=(01:'PROCESS COMPLETED AT ',                     
              22:&DATE(MD4/),33:&TIME)                       
    OUTREC IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,NE,C'*'),
    OVERLAY=(276:C'USER |',293,8,C'           ')),           
    IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,EQ,C'*'),       
    OVERLAY=(276:C'USER |',293,7,C'            '))           
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR 


It doesn't like this not-allowed format
Code:
                 
             20:&DATE(MD4/),                                 
                           *                                 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR 


The correct syntax works perfectly
Code:
 INREC BUILD=(C'PROCESS STARTED AT ',
              &DATE1(/),X,
              &TIME2(:))
 SORT FIELDS=COPY
 END


It has produced
Code:
PROCESS STARTED AT 2022/05/05 09:38


The same format will work with HEADER=, and TRAILER= as well.

Please, try to read the manuals MORE CAREFULLY, and do not bother people with such questions.
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 7:11 pm
Reply with quote

the problem is that it does work with the straight &time parm.
it doesn't work with &time2
is &time2 only for outrec?

look at this code below. I executed before making the change to &time2.
it does work fine.
cross posting in mainframe forum
thanks for your time, Sergeyken

Code:
SYSIN :                                                                           
  DEBUG NOABEND                                                                   
  OMIT COND=((01,8,EQ,C'PROCESS '),OR,(1,07,EQ,C'SYSPLEX')),FORMAT=CH             
  SORT FIELDS=(1,335,A),FORMAT=CH                                                 
  SUM FIELDS=NONE                                                                 
  OUTFIL REMOVECC,                                                               
    HEADER1=(01:'PROCESS STARTED AT ',                                           
             20:&DATE(MD4/),                                                     
             31:&TIME,/,                                                         
             01:'SYSPLEX|RESOURCE TYPE|RESOURCE',                                 
             31:'|GROUP/|PLATFORM'),                                   
    TRAILER1=(01:'PROCESS COMPLETED AT ',                                         
              22:&DATE(MD4/),33:&TIME)                                           
    OUTREC IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,NE,C'*'),                   
    OVERLAY=(276:C'USER |',293,8,C'           ')),                               
    IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,EQ,C'*'),                           
    OVERLAY=(276:C'USER |',293,7,C'            '))                               
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED                   
WER276B  SYSDIAG= 8170060, 10764778, 10764778, 19858215                           
WER164B  24,592K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,               
WER164B     0 BYTES RESERVE REQUESTED, 24,544K BYTES USED                         
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                                   
WER108I  SORTIN   : RECFM=FB   ; LRECL=   600; BLKSIZE= 27600                     
WER073I  SORTIN   : DSNAME=SYS22125.T084534.RA000.MSDCSDTD.CSDBACL.H0C           
WER237I  OUTREC RECORD LENGTH =   600                                             
WER110I  SORTOUT  : RECFM=FB   ; LRECL=   600; BLKSIZE= 27600                     
WER074I  SORTOUT  : DSNAME=ZA2T.NDM.ACF2.ACL.DEV.MAY03                           
WER410B  23,564K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,   
WER410B     0 BYTES RESERVE REQUESTED, 23,560K BYTES USED                         
WER036B  G=3368,B=88,BIAS=30                                                     
WER045C  END SORT PHASE                                                           
WER531I  ESTR=35,NSTR=91                                                         
WER055I  INSERT          0, DELETE      15910                                     
WER418I  DATASPACE(S) AND/OR ZSPACE USED                                         
WER405I  SORTOUT  :  DATA RECORDS OUT     412293; TOTAL RECORDS OUT     412296   
WER493I  ZIIP PROCESSOR USED                                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                     
WER416B  SORTIN   : EXCP'S=36,UNIT=3390,DEV=38CB,CHP=(40414243454647,1),VOL=1SS#A#
WER416B  OUTFIL WAS USED FOR SORTOUT                                             
WER246I  FILESIZE 256,920,000 BYTES                                               
WER054I  RCD IN     428203, OUT     412293                                       
WER072I  EQUALS, BALANCE IN EFFECT                                               
WER169I  RELEASE 3.1 BATCH 0541 TPF LEVEL 4.0   
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 7:14 pm
Reply with quote

I didn't look at the second part of your post... trying it with &date1
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 05, 2022 7:19 pm
Reply with quote

Your DATE format is not allowed
Code:
&DATE1[{±}nnnn]     C'yyyymmdd'
&DATE1(c)[{±}nnnn]  C'yyyycmmcdd'
&DATE1P[{±}nnnn]    +yyyymmdd
&DATE2[{±}nnn]      C'yyyymm'
&DATE2(c)[{±}nnn]   C'yyyycmm'
&DATE2P[{±}nnn]     +yyyymm
&DATE3[{±}nnnn]     C'yyyyddd'
&DATE3(c)[{±}nnnn]  C'yyyycddd'
&DATE3P[{±}nnnn]    +yyyyddd
&DATE4[{±}nnnn]     C'yyyy-mm-dd-hh.mm.ss'
&DATE5[{±}nnnn]     C'yyyy-mm-dd-hh.mm.ss.nnnnnn'


The only allowed syntax is
Code:
&DATE=(m1m2m3m4)±nnnn
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 7:25 pm
Reply with quote

NOPE...
didn't like it either.
perhaps &date1 & &time2 work only on INREC/OUTREC statements but not on Header
this time it move the error to the top of the header line

Code:
SYSIN :                                                       
  DEBUG NOABEND                                               
  OMIT COND=((01,8,EQ,C'PROCESS '),OR,(1,07,EQ,C'SYSPLEX')),FO
  SORT FIELDS=(1,335,A),FORMAT=CH                             
  SUM FIELDS=NONE                                             
  OUTFIL REMOVECC,                                           
    HEADER1=(01:'PROCESS STARTED AT ',                       
                                     *                       
             20:&DATE1(/),                                   
             31:&TIME2(:),/,                                 
             01:'SYSPLEX|RESOURCE TYPE|RESOURCE',             
             31:'|GROUP/ID|PLATFORM|'),               
    TRAILER1=(01:'PROCESS COMPLETED AT ',                     
              22:&DATE(MD4/),33:&TIME)                       
    OUTREC IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,NE,C'*'),
    OVERLAY=(276:C'USER |',293,8,C'           ')),           
    IFTHEN=(WHEN=(293,7,BI,EQ,MN,AND,300,1,CH,EQ,C'*'),       
    OVERLAY=(276:C'USER |',293,7,C'            '))           
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
migusd

New User


Joined: 08 Aug 2014
Posts: 44
Location: USA

PostPosted: Thu May 05, 2022 7:35 pm
Reply with quote

no need to post aggressive comments, Sergeyken
Straight from manual page 2-151
MD4(/) mentioned.

anyway thanks for time
sorry if you feel I am wasting someone else time. Including yours. wasn't my intention
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 05, 2022 7:46 pm
Reply with quote

migusd wrote:
no need to post aggressive comments, Sergeyken
Straight from manual page 2-151
MD4(/) mentioned.

anyway thanks for time
sorry if you feel I am wasting someone else time. Including yours. wasn't my intention


Please! Read the manual carefully!!!

This is syntax for a field conversion!!!
Code:
field,Y2T,DT=(MD4/)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 05, 2022 7:58 pm
Reply with quote

The formats allowed for HEADER/TRAILER are as follows:
Code:
&DATE±nnnn
&DATE=(m1m2m3m4)±nnnn
&DATENS=(xyz)±nnnn
&YDDD=(m1m2m3)±nnnn
&YDDDNS=(m1m2)±nnnn
&TIME
&TIME=(hp)
&TIMENS=(tt)

See Page 2.95


If only you followed the manual exactly as it shows, everything would work perfectly.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top