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 

Divide a field by a constant using an utility

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Tue Apr 19, 2005 12:00 pm    Post subject: Divide a field by a constant using an utility Reply with quote

I want to divide a particular field in a file by 2. Basically if the field has values 2,8,6 etc it should contain 1,4,3 etc
I can do it by writing a program or downloading into an excel. Is there any other way to do this?
_________________
Cheers!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 19, 2005 12:29 pm    Post subject: Reply with quote

abracadabra,

Please post with a meaningful topic titles. More over it does not match the content of the post. I am editing the topic title to match the post content.

You can use math functions(add,subtract,multiply,divide) with sort products.

ex:
Code:


//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
002
008
006
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,3,ZD,DIV,+2,EDIT=(TTT))
/*


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Apr 19, 2005 2:09 pm    Post subject: Reply with quote

For complete details on using DFSORT's arithmetic functions in INREC, OUTREC or OUTFIL, see:

http://www.ibm.com/servers/storage/support/software/sort/mvs/uq90053/online/srtmurfm.html#exp
_________________
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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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