Gilson,

DFSORT does NOT support date arithmetic on Header/Trailers. However it is
an easy fix as you just need to add an INREC/OUTREC to get the desired
results.  Basically we add the Current date-1 using OUTREC at a temporary
position say in this case 1501 ( as your LRECL is 1500) and then use it in
the header1  control cards.

Use the following DFSORT control cards which will give you the desired
results.

//SYSIN    DD *
  OPTION COPY
  OUTREC OVERLAY=(1501:DATE1-1)

  OUTFIL REMOVECC,INCLUDE=(1,1,CH,EQ,C'1'),
  HEADER1=(C'H',DATENS(4MD),TIMENS(24),1501,8),
  OUTREC=(C'DW',1,1269)
/*


Further if you have any questions please let me know

Thanks,
Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on
09/24/2019 03:50:07 AM:

> From: Gilson Cesar de Oliveira <gil...@gmail.com>
> To: IBM-MAIN@LISTSERV.UA.EDU
> Date: 09/24/2019 03:51 AM
> Subject: [EXTERNAL] Re: DFSORT Header1 with Date
> Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>
>
> Dear list:
>
>   Follow the results using DFSORT:
> ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS,
> EXAMPLES AND MORE
> ICE000I 0 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R3  - 06:
> 00 ON SUN SEP 22, 2019 -
>            OPTION COPY

>            OUTFIL FNAMES=SORTOUT,REMOVECC,INCLUDE=(1,1,CH,EQ,C'1'),

>            HEADER1=(C'H',DATENS(4MD),TIMENS,DATENS(4MD)-1),

>                                            $

> ICE007A 1 SYNTAX ERROR

>            TRAILER1=(C'T',COUNT+2=(M11,LENGTH=10)),

>            $

> ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED
> CORRECTLY
>            OUTREC=(C'D',

>                  $

> ICE007A 1 SYNTAX ERROR

>            C'W',

>             $

>
>
> The problem is in HEADER1 where it doesn't recognise DATENS(4MD)-1
syntax.
>
> The input file has the following:
> RECFM=FB
> LRECL=1500
>
> The content is the following:
> 0000002125201909230000000000000000000000000000000000000000000000
> 1407000004148423602599940700043203249748000044070004320324974800
> 1407000086381980020499940700043203286872920034070004320328687292
> 1407000090365278068099940700040043713848550064070004004371384855
> 1407000028887336531009940700043203262145410094070004320326214541
> 1407000085842023864349940700043203267612270024070004320326761227
> 1407000003667305626689940700043203224981010084070004320322498101
> 1407000028041106581529940700043203250917610034070004320325091761
>
>
> The OUTPUT file (SORTOUT) has the following format:
>
> RECFM=FB
> LRECL=1271
>
> The content in the SORTOUT is the following:
>
> H2019092106001820190920
> DW40700000371144234620994070004320325220398008407000432032522039813
> DW40700008902827390507994070004320328121127005407000432032812112714
> DW40700002801894591151994070004320325054784000407000432032505478413
> DW40700000340219305668994070004320325749122004407000432032574912212
> DW40700008504750297550994070004320326695168009407000432032669516812
> DW40700008625679686015994070004320328530484005407000432032853048412
> DW40700000336669482787994070004320325770420004407000432032577042014
>
> The syntax when using SYNCSORT runs fine.
>
> When using DFSORT there is a syntax error and we are researching for
> an alternative using it.
>
>
> Regards,
>
> Gilson
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to