View previous topic :: View next topic
|
Author |
Message |
razesh84
New User
Joined: 05 Apr 2010 Posts: 41 Location: Kolkata,India
|
|
|
|
Hi,
In my file i have a comp3 field [S9(2)V9(4) COMP-3].I need to convert this field into a S9(2)V9(4) COMP-3 field.My input file looks like this.
Code: |
ACCTNO PRDINC PRDPRN
9/AN 4/PS 20/AN
(1-9) (10-13) (14-33)
2-------- 3-------- 4--------
Record--1 20.1235 Trailer1
Record--2 0.0015 Trailer2
Record--3 11.0150 Trailer3
Record--4 0 Trailer4
Record--5 11.0004 Trailer5
Record--6 4.7800 Trailer6 |
My expected ouput file
Code: |
ACCTNO2 PRDINC2 PRDPRN2
9/AN 3/PS 20/AN
(1-9)R (10-12)R (13-24)R
6-------- 7------- 8---------
Record--1 20.12 Trailer1
Record--2 0 Trailer2
Record--3 11.01 Trailer3
Record--4 0 Trailer4
Record--5 11.00 Trailer5
Record--6 4.78 Trailer6 |
Can it be done with sort? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, you can divide the field by 100 and put the result back where the field came from.
You can temporarily add a Zoned Decimal to the file, source it from the comp-3, then put it back in the original site of the comp-3 but having reduced the length of the Zoned Decimal by two, although this becomes more complex with a signed field, like you have. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
razesh84 wrote: |
Hi,
In my file i have a comp3 field [S9(2)V9(4) COMP-3].I need to convert this field into a S9(2)V9(4) COMP-3 field.My input file looks like this. |
You mean S9(2)V9(2) ? You have the same for both input and output.
Use the following control cards.
Code: |
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(10:10,4,PD,DIV,+100,PD,LENGTH=4)
//* |
|
|
Back to top |
|
|
|