View previous topic :: View next topic |
Author |
Message |
maxisnowhere Beginner
Joined: 25 May 2005 Posts: 59 Topics: 20
|
Posted: Fri May 11, 2007 7:04 am Post subject: how to truncate a field? |
|
|
Hello Guys,
I'm sorry to bother you but I 've a small problem.
I have a file like this:
Code: |
AA 1.2354
BB125.5478
CC 26.4587 |
I would like to trunkate the decimal digits and obtain record like this:
Code: | AA 1.23
BB 125.54
CC 26.45 |
Do you have any idea of how can I do that?
Thanks a lot! _________________ Maxisnowhere |
|
Back to top |
|
|
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Fri May 11, 2007 7:10 am Post subject: |
|
|
What "tools" are you expecting to do this with?
SORT? A very simple inrec/outrec reformat can do it. |
|
Back to top |
|
|
maxisnowhere Beginner
Joined: 25 May 2005 Posts: 59 Topics: 20
|
Posted: Fri May 11, 2007 7:11 am Post subject: |
|
|
Yes, I would like to use a SORT, but it is to me unclear how to do that...thx _________________ Maxisnowhere |
|
Back to top |
|
|
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
|
Back to top |
|
|
maxisnowhere Beginner
Joined: 25 May 2005 Posts: 59 Topics: 20
|
Posted: Fri May 11, 2007 7:30 am Post subject: |
|
|
Yes, the problem is that I don't find how to reformat my record....I thought I should use the INREC - OUTREC combination, to put in the new record two blanks before the number and take just 6 position of my number...but I don't find how... _________________ Maxisnowhere |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 11, 2007 8:17 am Post subject: |
|
|
maxisnowhere,
Try this
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(3:3,8,UFF,MUL,+100,DIV,+10000,EDIT=(IIIIT.TT))
/*
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
|
Back to top |
|
|
maxisnowhere Beginner
Joined: 25 May 2005 Posts: 59 Topics: 20
|
Posted: Fri May 11, 2007 8:40 am Post subject: |
|
|
Thank you guys!! I got it!
Probably not the best soluion of the world but anyway it goes!!
I did something like this:
Code: |
INREC FIELDS=(1,2 ,3,6)
OUTREC BUILD=(1,2,C' ',3,6) |
It look it function!!
Wish you all a nice week end!!! _________________ Maxisnowhere |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri May 11, 2007 10:50 am Post subject: |
|
|
Quote: | I thought I should use the INREC - OUTREC combination |
Why do you think you need INREC and OUTREC? You can do it with just one. For example:
Code: |
INREC BUILD=(1,2,2X,3,6)
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Fri May 11, 2007 11:20 am Post subject: |
|
|
Frank Yaeger wrote: | Why do you think you need INREC and OUTREC? | A belt and suspenders man? |
|
Back to top |
|
|
|
|