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
 

 

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 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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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