Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7312

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 Syncsort for field to field comparision Deepti_R SYNCSORT 3 Thu Nov 07, 2019 11:04 pm
No new posts SECTION BASED ON FIELD speermb DFSORT/ICETOOL 10 Mon Jun 17, 2019 9:41 pm
No new posts Send text at cursor position on an IS... Domenic Ailati CLIST & REXX 10 Sun Jun 02, 2019 7:34 am
No new posts Display Signed ZD field socker_dad DFSORT/ICETOOL 11 Thu Feb 28, 2019 1:17 am
No new posts DB2 Timestamp field weird behaviour. rizwanaccy DB2 8 Wed Dec 26, 2018 4:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us