There's a crude way to do this by aligning the data in a series of temp
files, i.e. 

OUTREC OUTFIL=OUT1,
       INCLUDE=(8,3,CH,EQ,C'99~'),           WHEN COL 8 IS THE DESIRED 99~
       OUTREC=(11,5)                         numeric data following the ~

repeat this block of lines for every mutation of where ~ occurs.  write an
additional
OUTFIL for each mutation.  then concat each file into a SUM step.

Hey, the price is right......

 

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Chase, John
Sent: Monday, August 08, 2005 7:05 AM
To: [email protected]
Subject: Re: SORT help - to split by delimiters

> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of Ramya Ramaswamy
> 
> Hi,
> 
> I have a requirement which states like this:
> 
> Given records like
> 
> 1~ABC~99.99~12345
> 123~AB~9.99~567
> 34~c~1.99~345
> 
> where there are 4 fields in each record, each separated by a '~'. The 
> third field is the price field, which i need to sum up. I wont know 
> the starting position / length of the fields.
> Is there any way that i can sum up the price, using Sort or DYL, 
> without having to write a COBOL program using UNSTRING?

You could write an assembler E15 exit program using TRT....

Not familiar with DYL, but AFAIK the SORT utilities require the SUMmed
fields to be the same length, format and offset in every record.

    -jc-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the
archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to