Using s9(13)v99 in include condition



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Using s9(13)v99 in include condition

Postby sunilpatwal » Wed Jun 06, 2012 5:55 pm

Hi,
Which format should I use in INCLUDE of the sort card if the COBOL PIC clause is S9(13)V99.
For example I want the records with value less then 5000.00 to be included.WHat should be the sort card?
Please help. I tried a lot for this. not sure where I am doing wrong.
INCLUDE COND(140,15,??,LT,5000)

Thanks,
sunilpatwal
 
Posts: 3
Joined: Mon Dec 05, 2011 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using s9(13)v99 in include condition

Postby Robert Sample » Wed Jun 06, 2012 6:00 pm

The V in a COBOL PICTURE is an implied decimal. Using a compare against 5000 in your SORT statement, you are comparing against 50.00, not 5000. You need to change your SORT statement to 500000 to include the decimal digits -- since the decimal point does not exist.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Using s9(13)v99 in include condition

Postby sunilpatwal » Wed Jun 06, 2012 6:06 pm

Hi Robert,
Thanks for quick reply. The amount mentioned in the above sort card was an example. I had tried with 500000 for 5000, but the results are not as expected. I am not sure about the data format to be used. I had placed ?? in the sort card above. Need help on the data format (ZD, SFF, FI etc) to be used.

Thanks.
sunilpatwal
 
Posts: 3
Joined: Mon Dec 05, 2011 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using s9(13)v99 in include condition

Postby Robert Sample » Wed Jun 06, 2012 6:12 pm

You need to look at the full COBOL definition -- USAGE DISPLAY (the default) is ZD to SORT, COMP-3 is PD to SORT, COMP is BI to SORT, and so forth. If you're not getting the results you expect, you could be using the wrong starting position (if the file is variable), or you could be getting the right results for the data in the file, or .... Perhaps the first question to answer is why do you think the results are wrong? The computer won't lie to you, and it very seldom gets arithmetic wrong, so if the results you're getting don't agree with what you think you should be getting, there's a reason for that to be found.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Using s9(13)v99 in include condition

Postby dick scherrer » Wed Jun 06, 2012 9:42 pm

Hello,

It may help if you show the field from the input file in hex - only a few values please.

Show what you expect the output to be from these values and what values are in the current output.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Using s9(13)v99 in include condition

Postby skolusu » Wed Jun 06, 2012 10:58 pm

Sunil

Here is a link which shows DFSORT Formats for COBOL Data Types. http://publibz.boulder.ibm.com/cgi-bin/ ... e1ca60/C.3?

In your case S9(13)V99. is a 15 byte ZD field. So your INCLUDE condition should be
INCLUDE COND=(140,15,ZD,LT,500000)
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Using s9(13)v99 in include condition

Postby sunilpatwal » Thu Jun 07, 2012 1:01 pm

Thanks Robert, Dick and sko,
The problem is resolved now. I had tried everything before coming to the forum. Only silly mistake I did was, did not check that I am working with VB file. Checked later and the sort card worked fine with ZD itself.

Thanks all for help.
sunilpatwal
 
Posts: 3
Joined: Mon Dec 05, 2011 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using s9(13)v99 in include condition

Postby dick scherrer » Thu Jun 07, 2012 8:28 pm

Good to hear it is workinig - thank you for posting the solution :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post