SORT help needed for date manipulation.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
passion56
New Member
Posts: 3
Joined: Fri May 20, 2016 9:48 pm

SORT help needed for date manipulation.

Post by passion56 »

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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: SORT help needed for date manipulation.

Post by nicc »

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
User avatar
Magesh_j
Registered Member
Posts: 33
Joined: Sun Sep 04, 2016 8:50 pm

Re: SORT help needed for date manipulation.

Post by Magesh_j »

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
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

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