IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to move 0(ZERO) to OUTREC field doing SORT/SUM


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Megalai

New User


Joined: 13 Jan 2006
Posts: 16

PostPosted: Wed Mar 07, 2007 5:17 pm
Reply with quote

Hi Friends,

My requirement is I am doing SORT/SUM. In that I have to move 0(ZERO) to my OUTREC field Commission amount. It is declared as S9(13)V99 PACKED-DECIMAL. It's LRECL=172,RECFM=FB.

For Example it is having data in the pos (145-152) as foll.

-189.91
-1614.93
-1484.63
-571.60
-1722.63

If it is CHAR field we can move like
C'12.01.2001', 'DATE FIELD.
As it is COMP filed i don't know how to do that..

So could u please help me out?

Thanks and Regards,
Megalai.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 07, 2007 10:05 pm
Reply with quote

I don't understand what you're trying to do. You've used some COBOL terms and some Sort terms, but it isn't clear how it all fits together.

You show a packed decimal field with a decimal point. Packed decimal fields only have an implied decimal point - the decimal point is not actually stored internally in the field. You say something about moving zero to some field, but I don't see how that fits in. You also talk about a COMP field, but PD is COMP-3, not COMP.

You need to explain what you're trying to do more clearly before I can help you.
Back to top
View user's profile Send private message
Megalai

New User


Joined: 13 Jan 2006
Posts: 16

PostPosted: Thu Mar 08, 2007 9:37 am
Reply with quote

Hi Frank,

Sorry for that. Please find the details.

This is my SORT code.

SORT FIELDS=(1,4,CH,A, 'BOOKS
5,3,CH,A, 'ELEMENT-2
8,3,CH,A) 'CHANNEL-3

SUM FIELDS=(137,8,PD, 'PREMIUM
145,8,PD) 'GROSS-WRITTEN-COMM

OUTREC FIELDS=(1,4, ' BOOKS
5,3, 'ELEMENT-2
8,3, 'CHANNEL-3
137,8, 'PREMIUM
145,8) 'GROSS-WRITTEN-COMM

We are loading these Output filelds into DB2 table. Now i got the
requirement like i have to move Zeroes externally to the field
Gross-Writen-Comm(GWC) in the pos(145,8). Could u please help me
out?

Thanks and Regards,
Megalai.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 08, 2007 9:31 pm
Reply with quote

You can use:

Code:

145:+0,TO=PD,LENGTH=8
Back to top
View user's profile Send private message
Megalai

New User


Joined: 13 Jan 2006
Posts: 16

PostPosted: Fri Mar 09, 2007 8:45 am
Reply with quote

Hi Frank,

Thank u. I will try that.

Regards,
Megalai.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Mon Mar 12, 2007 1:57 pm
Reply with quote

Hi Megalai,

you can try this to move zero to the position from 145

145:X'000000000000000C'

Regards
Sai
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top