View previous topic :: View next topic
|
Author |
Message |
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi,
I have one file (FB,RECL=80) which has one field whose value is in the format like 999,999.99
I wanted to do summation of this field before which I wanted to convert that to 99999999. I used below in sort but it is giving error S0C7
INREC FIELDS=(02,11,ZD,EDIT=(IIIIIIIIIIT))
SORT FIELDS=COPY
Anybody know how to do this? |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Shriram Jogdand,
Please show us sample input and if possible input field's declaration as well. Looks like your input is assumed decimal.
Thanks, |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
The input field looks like
19,738.10
10.00
19,559.00
7,198.72
0.00
This file is created through sort and had edited this in outrec as (III,III,III.IT)
I wanted to revert back to have without comma and decimal. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Maybe UFF to ZD |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
It worked. Thanks. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Shriram Jogdand,
My 2 cents... If you are creating input file for this process,using SORT and OUTREC, why not use OUTFIL FNAMES to save one pass? Something like below for 80 byte fb file. All you have to do is replace OUTREC with OUTFIL FNAMES and add another OUTFIL FNAMES with fields you want.
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,BUILD=(1,1,
2,11,ZD,EDIT=(III,III,III.IT),LENGTH=14, --> File created from previous step
13,68)
OUTFIL FNAMES=OUT2,BUILD=(1,80) --> File that you need in the original post.
/* |
Thanks, |
|
Back to top |
|
|
|