Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Megalai

New User

Joined: 13 Jan 2006
Posts: 16

 Posted: Wed Mar 07, 2007 5:17 pm    Post subject: How to move 0(ZERO) to OUTREC field doing SORT/SUM 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.

Frank Yaeger

DFSORT Moderator

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

 Posted: Wed Mar 07, 2007 10:05 pm    Post subject: 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.
Megalai

New User

Joined: 13 Jan 2006
Posts: 16

 Posted: Thu Mar 08, 2007 9:37 am    Post subject: Re: How to move 0(ZERO) to OUTREC field doing SORT/SUM 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.
Frank Yaeger

DFSORT Moderator

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

Posted: Thu Mar 08, 2007 9:31 pm    Post subject:

You can use:

 Code: 145:+0,TO=PD,LENGTH=8
Megalai

New User

Joined: 13 Jan 2006
Posts: 16

 Posted: Fri Mar 09, 2007 8:45 am    Post subject: Re: How to move 0(ZERO) to OUTREC field doing SORT/SUM Hi Frank, Thank u. I will try that. Regards, Megalai.

Active User

Joined: 20 Sep 2006
Posts: 154
Location: US

 Posted: Mon Mar 12, 2007 1:57 pm    Post subject: Hi Megalai, you can try this to move zero to the position from 145 145:X'000000000000000C' Regards Sai
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us