IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to add or subtract by using the sort jcl


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
girish_firke

New User


Joined: 29 Aug 2006
Posts: 3

PostPosted: Tue Jan 16, 2007 7:55 pm
Reply with quote

Hi icon_biggrin.gif ,
I am sorting a file on the basis of employee id. and i want to perform some arithmatic operation on the salary field. I want to subtract salary from 99999999. I know we can do this by using OUTREC. but i dont know exact syntax of that. Can anybody help me on this.

thanks!!! icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 8:24 pm
Reply with quote

Quoth the Fine DFSORT manual:
Quote:
arexp,edit or (arexp),edit
Specifies that the edited result of an arithmetic expression is to appear in the reformatted OUTFIL output record. An arithmetic expression takes the form:
term,operator,term<,operator,...> where:
. term is a field (p,m,f), a parsed field (%nn,f), or a decimal constant (+n or −n). See p,m,f under p,m,f,edit for details on the fields you can use. See deccon under deccon,edit for details on the decimal constants you can use.
. operator is MIN (minimum), MAX (maximum), MUL (multiplication), DIV (division), MOD (modulus), ADD (addition) or SUB (subtraction).

Ex:
OUTREC=(5:C?% REDUCTION FOR ?,21,8,C? IS ?, ((11,6,ZD,SUB,31,6,ZD),MUL,+1000),DIV,11,6,ZD, EDIT=(SIIT.T),SIGNS=(+,-))
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 16, 2007 10:03 pm
Reply with quote

girish,

The syntax for the DFSORT INREC statement would be something like this:

Code:

  INREC FIELDS=(...,+99999999,SUB,p,m,f,TO=ZD,LENGTH=n,...)


where p,m,f is the starting position, length and format of your salary field and n is the length of the output field. You didn't give enough details for me to be more specific.

For more information, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.10?DT=20060615173822

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
PadmaPriya
Warnings : 2

New User


Joined: 19 Jan 2007
Posts: 3
Location: Bangalore

PostPosted: Mon Jan 22, 2007 2:14 pm
Reply with quote

Hi

My report has 3 fields and I want the output to be sorted based on the first field and find the total sum of the next field for all the records.

I want them to be done using any SORT or SYNCSORT.


In SYNCSORT, I want to know abt the SUM FIELDS= in detail.


Can anyone help in this regard?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 22, 2007 9:41 pm
Reply with quote

Quote:
I want them to be done using any SORT or SYNCSORT.


What do you mean by "any SORT"? Do you mean DFSORT?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top