Date Conversion in SORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

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:

 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:
OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Any hints ? Thank you, GG
golemis
 
Posts: 18
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 3 times
Been thanked: 0 time

Re: Date Conversion in SORT

 

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:

 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:
OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Any hints ? Thank you, GG


Replacing the OUTFIL statement with :
  OUTFIL BUILD=(10,5,Y2T)

I managed to get 2019121 (yyddd)! Question now is how I convert it to ddmmyyyy
golemis
 
Posts: 18
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 3 times
Been thanked: 0 time

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:

 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:
OUTFIL BUILD=(C'NARRATIVE11',10,5,Y2T,DT=(DM4),81X)
                                              £


Got it !
OUTFIL BUILD=(10,5,Y2T,DTNS=(DM4))


Any hints ? Thank you, GG
golemis
 
Posts: 18
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 3 times
Been thanked: 0 time

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 ???
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

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: 18
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 3 times
Been thanked: 0 time

Re: Date Conversion in SORT

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

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

solves my issue. Thank you all for your attention
golemis
 
Posts: 18
Joined: Wed Apr 04, 2018 8:13 pm
Location: London, UK
Has thanked: 3 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post