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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

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