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

Insert System Runtime in HEADER In SYNCSORT In Char Format


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

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Tue May 26, 2020 9:01 pm
Reply with quote

Hello! I am creating a Report. Here is what I have for my Header:
Code:
 OUTFIL HEADER1=(1:'BACKORDERED PARTS WITH NO SDI',                     
                42:&TIME=(12:),81:'1',                                 
*           ' ',53:WEEKDAY=(CHAR9),',',' ',&DATE=(M=(CHAR9),D,4)),     
              3/38:'EMER',/,                                           
              5:'PART NUMBER',25:'B/O DATE',38:'ORDERS',48:'LINES',/,   
              2:'------------------',25:'----------',38:'------',       
             48:'-----',/),                                             


Here is what my output needs to look like:
Code:
********************************* Top of Data **********************************
1BACKORDERED PARTS WITH NO SDI                     11:05 Friday, May 15, 2020   
                                                                               


How can I format the system date like this? I cannot find anything specific on how to code the parameters for &DATE. Thanks!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 26, 2020 9:50 pm
Reply with quote

The same people who respond on this board also respond on the other board, so posting here will not get you better answers than you've already gotten. The lack of responses so far may indicate that nobody knows how to do what you want, or that what you want cannot be done, or nobody with the appropriate knowledge has read your posts.

Furthermore, since Syncsort is an independent software vendor product, you are VASTLY more likely to get what you want by contacting Syncsort support and working with them. Vendors know their products, generally, much better than people responding on a forum. And if your site has a license for Syncsort then you are entitled to get support from them.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Tue May 26, 2020 10:00 pm
Reply with quote

Input:
Code:
  OPTION COPY                                                         
  OUTREC IFTHEN=(WHEN=INIT,                                           
    OVERLAY=(81:TIME2(:),X,112:DATE1,120:112,8,Y4T,WEEKDAY=DIGIT1,     
             87:117,1,CHANGE=(10,C'1',C'Sunday,',                     
                                 C'2',C'Monday,',                     
                                 C'3',C'Tuesday,',                     
                                 C'4',C'Wednesday,',                   
                                 C'5',C'Thursday,',                   
                                 C'6',C'Friday,',                     
                                 C'7',C'Saturday,'),                   
             98:116,2,CHANGE=(9,C'01',C'January',                     
                                C'02',C'February',                     
                                C'03',C'March',                       
                                C'04',C'April',                       
                                C'05',C'May',                         
                                C'06',C'June',                         
                                C'07',C'July',                         
                                C'08',C'August',                       
                                C'09',C'September',                   
                                C'10',C'October',                     
                                C'11',C'November',                     
                                C'12',C'December'),                   
             108:118,2,C',',X)),                                       
    IFTHEN=(WHEN=INIT,BUILD=(1,80,81:81,35,SQZ=(SHIFT=RIGHT,MID=C' ')))
  OUTFIL FNAMES=(SORTOUT),                                         
    HEADER1=(1:'BACKORDERED PARTS WITH NO SDI',                     
             46:81,35,                                             
             3/38:'EMER',/,                                         
             5:'PART NUMBER',25:'B/O DATE',38:'ORDERS',48:'LINES',/,
             2:'------------------',25:'----------',38:'------',   
             48:'-----',/),                                         
    BUILD=(1,80)                                                   
  END                                                               

Output (Browse Mode):
Code:
********************************* TOP OF DATA **********************************
BACKORDERED PARTS WITH NO SDI                       18:27 Thursday, May 26, 2020
                                                                               
                                     EMER                                       
    PART NUMBER         B/O DATE     ORDERS    LINES                           
 ------------------     ----------   ------    -----                           
                                                                               
DUMMY                                                                           
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Tue May 26, 2020 11:19 pm
Reply with quote

THANK YOU SO MUCH!!!!!! IT works perfectly! I THOUGHT I posted this on the SYNCSORT Forum. My apologies!!
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Wed May 27, 2020 12:21 am
Reply with quote

I was trying to figure this out but I am having no luck. Why is it showing today's date as THURSDAY? Where in DATE1 is there a day of the week position? I keep looking at this and DATE1 should be YYYYMMDD. Am I missing something?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Wed May 27, 2020 6:56 am
Reply with quote

I just noticed that I have applied a wrong offset for the day of week. icon_confused.gif

Change:
Code:
87:117,1,CHANGE=(10,C'1',C'Sunday,',

to:
Code:
87:120,1,CHANGE=(10,C'1',C'Sunday,', 

Output:
Code:
BACKORDERED PARTS WITH NO SDI                      03:21 Wednesday, May 27, 2020
                                     EMER                                       
    PART NUMBER         B/O DATE     ORDERS    LINES                           
 ------------------     ----------   ------    -----                           
                                                                               
DUMMY                                                                           
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Wed May 27, 2020 5:40 pm
Reply with quote

Thank you!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2011
Location: USA

PostPosted: Wed May 27, 2020 10:13 pm
Reply with quote

Joerg.Findeisen wrote:
I just noticed that I have applied a wrong offset for the day of week. icon_confused.gif


Unnoticed problem: the date is being fully re-calculated for EACH record of the report, plus INSERTED only when header line position is reached. In case of HEADER1 - it is used once per report...

But, who cares nowadays?.....
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Thu May 28, 2020 12:06 am
Reply with quote

sergeyken wrote:
Unnoticed problem: the date is being fully re-calculated for EACH record of the report, plus INSERTED only when header line position is reached. In case of HEADER1 - it is used once per report...

I can rest you assured that I was aware of that situation.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Thu May 28, 2020 12:32 am
Reply with quote

Code:
//DATETIME EXEC PGM=SORT,PARM='MSG=NO'               
//SORTIN   DD *                                         
DUMMY                                                   
/*                                                     
//SYSOUT   DD SYSOUT=*                                 
//SORTOUT  DD DISP=(NEW,PASS),UNIT=SYSALLDA,           
//            SPACE=(TRK,(1)),                         
//            DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0     
//SYSIN    DD *                                         
  OPTION COPY,STOPAFT=1                                 
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,                 
    OVERLAY=(TIME2(:),81:DATE1,81,8,Y4T,WEEKDAY=DIGIT1,
             7:89,1,CHANGE=(10,C'1',C'Sunday,',         
                               C'2',C'Monday,',         
                               C'3',C'Tuesday,',       
                               C'4',C'Wednesday,',     
                               C'5',C'Thursday,',       
                               C'6',C'Friday,',         
                               C'7',C'Saturday,'),     
             18:85,2,CHANGE=(9,C'01',C'January',       
                               C'02',C'February',       
                               C'03',C'March',         
                               C'04',C'April',         
                               C'05',C'May',           
                               C'06',C'June',           
                               C'07',C'July',           
                               C'08',C'August',         
                               C'09',C'September',                   
                               C'10',C'October',                     
                               C'11',C'November',                     
                               C'12',C'December'),                   
             28:87,2,C',',X,81,4)),                                   
    IFTHEN=(WHEN=INIT,                                               
      BUILD=(C'DateTime,''',1,35,SQZ=(SHIFT=RIGHT,MID=C' '),C''''))   
  END                                                                 
/*                                                                   
//SORTDATS EXEC PGM=SORT,PARM='MSG=NO'                             
//SYMNAMES DD DISP=(OLD,PASS),DSN=*.DATETIME.SORTOUT                 
//SYMNOUT  DD SYSOUT=*                                               
//SORTIN   DD *                                                       
Data                                                                 
Data                                                                 
Data                                                                 
/*                                                                   
//SYSOUT   DD SYSOUT=*                                               
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  OUTFIL FNAMES=(SORTOUT),                                           
    HEADER1=(1:'BACKORDERED PARTS WITH NO SDI',46:DateTime,           
             3/38:'EMER',/,                                           
             5:'PART NUMBER',25:'B/O DATE',38:'ORDERS',48:'LINES',/, 
             2:18C'-',25:10C'-',38:6C'-',48:5C'-',/),
    BUILD=(1,80)                                     
  END                                                 
/*                                                   


Makes use of SYMBOLS and calculates the requested Date/Time only once.

Code:
********************************* TOP OF DATA **********************************
BACKORDERED PARTS WITH NO SDI                      21:01 Wednesday, May 27, 2020
                                     EMER                                       
    PART NUMBER         B/O DATE     ORDERS    LINES                           
 ------------------     ----------   ------    -----                           
                                                                               
Data                                                                           
Data                                                                           
Data                                                                           
******************************** BOTTOM OF DATA ********************************
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 Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top