SORT help needed for date manipulation.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.

Topic author
passion56
New Member
Posts: 3
Joined: Fri May 20, 2016 9:48 pm
Has thanked: 2 times

SORT help needed for date manipulation.

Postby passion56 » Wed Sep 14, 2016 2:36 pm

Hello,

I need help in manipulating a date present in the header. For a file I have the header is in the form:

Code: Select all

ZHEDRFGG6500 YYYYMMDD


Code: Select all

RECORD-ID(1)-HEADERID(2-5)-Dataset ID(6-12)-YYYYMMDD(13-20)


Pos-13 to 20-Date= `YYYYMMDD' which i'm intrested in.

I want to reformat only the date from YYYYMMDD to DDMMYYYY in a single sort card, without changing the existing detail and footer records. Can you please help me out to do this. I failed to get it working with OVERLAY,OUTREC and INREC combinations.
But it did not work.



Tags:


nicc
Global Moderator
Global Moderator
Posts: 543
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 11 times

Re: SORT help needed for date manipulation.

Postby nicc » Wed Sep 14, 2016 3:49 pm

a file I have

Nope, you do not have a file. You have a data set.
And what do you mean by "did not work"? That phrase has several interpretations.


Regards
Nic


Magesh_j
Registered Member
Posts: 33
Joined: Sun Sep 04, 2016 8:50 pm
Has thanked: 1 time
Been thanked: 7 times

Re: SORT help needed for date manipulation.

Postby Magesh_j » Wed Sep 14, 2016 6:47 pm

Screen shot show date starts from 14th position, but you gave screen shot Date(13-20).

Code: Select all

 =COLS> ----+----1----+----2--
 000006 ZHEDRFGG6500 YYYYMMDD
 


if the date starts @ 14th column, use below code. Assuming LRECL=80

Code: Select all

INREC IFTHEN=(WHEN=(2,4,CH,EQ,C'HEDR'),   
              OVERLAY=(81:20,2,18,2,14,4, 
                       14:81,08)),         
      IFOUTLEN=80                         
                                           
OPTION COPY                               


Thanks
Magesh




Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests