Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to move 0(ZERO) to OUTREC field doing SORT/SUM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to move 0(ZERO) to OUTREC field doing SORT/SUM
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 Moderator


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

PostPosted: Wed Mar 07, 2007 10:05 pm    Post subject:
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    Post subject: Re: How to move 0(ZERO) to OUTREC field doing SORT/SUM
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 Moderator


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

PostPosted: Thu Mar 08, 2007 9:31 pm    Post subject:
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    Post subject: Re: How to move 0(ZERO) to OUTREC field doing SORT/SUM
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    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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