MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to truncate a field?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 11, 2007 7:04 am    Post subject: how to truncate a field? Reply with quote

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
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri May 11, 2007 7:10 am    Post subject: Reply with quote

What "tools" are you expecting to do this with?
SORT? A very simple inrec/outrec reformat can do it.
Back to top
View user's profile Send private message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 11, 2007 7:11 am    Post subject: Reply with quote

Yes, I would like to use a SORT, but it is to me unclear how to do that...thx
_________________
Maxisnowhere
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri May 11, 2007 7:14 am    Post subject: Reply with quote

Have you looked at a manual?
DFSORT/ICETOOL books and papers
Back to top
View user's profile Send private message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 11, 2007 7:30 am    Post subject: Reply with quote

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... Crying or Very sad
_________________
Maxisnowhere
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri May 11, 2007 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri May 11, 2007 8:21 am    Post subject: Reply with quote

Did you look at any of the examples in 3.8.2 Reformatting Records Before Processing -- Examples?
Back to top
View user's profile Send private message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 11, 2007 8:40 am    Post subject: Reply with quote

Thank you guys!! I got it!
Probably not the best soluion of the world Wink 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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri May 11, 2007 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri May 11, 2007 11:20 am    Post subject: Reply with quote

Frank Yaeger wrote:
Why do you think you need INREC and OUTREC?
A belt and suspenders man? Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group