Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Changing the precision of a comp3 field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
razesh84

New User


Joined: 05 Apr 2010
Posts: 41
Location: Kolkata,India

PostPosted: Tue Jan 08, 2013 3:06 pm    Post subject: Changing the precision of a comp3 field
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jan 08, 2013 5:24 pm    Post subject: Reply to: Changing the precision of a comp3 field
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jan 08, 2013 11:13 pm    Post subject: Re: Changing the precision of a comp3 field
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us