Date Conversion in SORT

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Date Conversion in SORT

Postby golemis » Wed May 01, 2019 3:47 pm

Hi,
I am struggling with a date conversion in SORT. I have to get a date from a file where first two chars is C'01' and the next five the Julian Date. And output a record of length 80 with
NARRATIVE11ddmmyyyy

I am using:

Code: Select all

 SORT FIELDS=COPY
   INCLUDE FORMAT=CH,COND=(2,2,CH,EQ,C'01')
   OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
   SUM FIELDS=NONE


But always get ABENDU0007 with SYNTAX ERROR At:

Code: Select all

OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Any hints ? Thank you, GG

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Date Conversion in SORT

Postby golemis » Wed May 01, 2019 5:24 pm

golemis wrote:Hi,
I am struggling with a date conversion in SORT. I have to get a date from a file where first two chars is C'01' and the next five the Julian Date. And output a record of length 80 with
NARRATIVE11ddmmyyyy

I am using:

Code: Select all

 SORT FIELDS=COPY
   INCLUDE FORMAT=CH,COND=(2,2,CH,EQ,C'01')
   OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
   SUM FIELDS=NONE


But always get ABENDU0007 with SYNTAX ERROR At:

Code: Select all

OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Any hints ? Thank you, GG


Replacing the OUTFIL statement with :

Code: Select all

  OUTFIL BUILD=(10,5,Y2T)

I managed to get 2019121 (yyddd)! Question now is how I convert it to ddmmyyyy

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Date Conversion in SORT

Postby golemis » Wed May 01, 2019 5:35 pm

golemis wrote:Hi,
I am struggling with a date conversion in SORT. I have to get a date from a file where first two chars is C'01' and the next five the Julian Date. And output a record of length 80 with
NARRATIVE11ddmmyyyy

I am using:

Code: Select all

 SORT FIELDS=COPY
   INCLUDE FORMAT=CH,COND=(2,2,CH,EQ,C'01')
   OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
   SUM FIELDS=NONE


But always get ABENDU0007 with SYNTAX ERROR At:

Code: Select all

OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Got it !

Code: Select all

OUTFIL BUILD=(10,5,Y2T,DTNS=(DM4))


Any hints ? Thank you, GG

expat
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm

Re: Date Conversion in SORT

Postby expat » Wed May 01, 2019 6:21 pm

My first question would be .............

If the LRECL is 80, does not 81X fill up to cc81 ???

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Date Conversion in SORT

Postby golemis » Wed May 01, 2019 9:05 pm

expat wrote:My first question would be .............

If the LRECL is 80, does not 81X fill up to cc81 ???


Thanks for the hint, found it out the hard way and corrected it.

golemis
Posts: 34
Joined: Wed Apr 04, 2018 8:13 pm
Skillset: z/OS, REXX, DB2, CICS, MQ, ISPF, DFSMS
Referer: google
Location: London, UK

Re: Date Conversion in SORT

Postby golemis » Wed May 01, 2019 9:07 pm

So:

Code: Select all

OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DTNS=(DM4),61X)

solves my issue. Thank you all for your attention


  • Similar Topics
    Replies
    Views
    Last post