Page 1 of 1

how to increment a numeric field with an integer

PostPosted: Wed Jul 09, 2008 11:47 am
by supriya saraswat
file1
00101
00104
00180
00189

output should be
file 2
00103
00106
00182
00191

how can i do this by using dfsort

Re: how to increment a numeric field with an integer

PostPosted: Wed Jul 09, 2008 9:39 pm
by Frank Yaeger
You can use a DFSORT job like the following to do what you asked for:

//S1    EXEC  PGM=ICEMAN                           
//SYSOUT    DD  SYSOUT=*                           
//SORTIN DD *                                     
00101                                             
00104                                             
00180                                             
00189                                             
/*
//SORTOUT DD SYSOUT=*                             
//SYSIN    DD    *                                 
  OPTION COPY                                     
  INREC OVERLAY=(1,5,ZD,ADD,+2,TO=ZD,LENGTH=5)     
/*

Re: how to increment a numeric field with an integer

PostPosted: Thu Jul 10, 2008 11:51 am
by supriya saraswat
thanks..