-1

MY requirement is to get same record counts using JCL - Syncsort.

MY Input File contains the packed decimal values in 58-60 position. I need to get the record count when the input in between 01 and 05 range.

Actually I tried to convert PD values into ZD and compare with C'01' and C'05'.

I could not get the result.

Ex: Input File data in 58-60 (3 bytes which is in Comp-3 Format)

07.2

05.2

04.0

45.7

02.4

Output will be:

RF value | Count

02.4 1

04.0 1

Can anybody please let me know how to acheive this?

Sekhar
  • 627
  • 4
  • 14
  • 34
  • Post your current Syncsort parms and I'll take a look. I would normally do this in DFSORT but I think Syncsort should work. Getting the counts might be trickier but we should at least be able to extract only the values between 1 and 5 pretty easily. – Marcus_33 Dec 15 '11 at 15:59

2 Answers2

2

Your specifications state that the field is 3-byte PD format, but you provide example records that conatin a decimal point. PD data cannot contain a decimal point, so I am going to assume that the decimal point is implied. The 3-bytes of data that correspond to your value 07.2 would actually contain x'00072C' for purposes of the following.

To make the example easier to understand (and not knowing details of your record layout), I am treating the 3-byte PD field as if it begins in position 1 of fixed-length data. Feel free to modify the example to fit your actual data layout.

//SYSIN  DD  *   
 SORT FIELDS=(1,3,PD,A)   
 INCLUDE COND=(1,3,PD,GT,10,AND,1,3,PD,LT,50)   
 OUTREC FIELDS=(1,3,PD,ZDF,75X) 
 OUTFIL FILES=OUT,NODETAIL,
              SECTIONS=(1,5,
                TRAILER3=(1:1,4,C'.',5,1,COUNT))
/*

For any further support, contact Customer Service, Syncsort Inc. zos_tech@syncsort.com

Bill Woodger
  • 12,968
  • 4
  • 38
  • 47
Brian Wood
  • 21
  • 1
1

Try this...

//SYSIN DD *
  INREC FIELDS=(1,4,C'00001')
  SORT FIELDS=(01,04,CH,A)
  SUM FIELDS=(05,05,ZD,A)
  OUTREC FIELDS=(01,04,05,05)
/*

Briefly, I'm adding a numeric 00001 to each record and sorting them on the numeric field and summing all such records, which will give you the desired output.

Raja Reddy
  • 772
  • 8
  • 19
  • 37
  • OVERLAY is clearer than FIELDS for the INREC. Your SUM is not valid syntax. Your OUTREC is pointless, as that is what the data already looks like. You should INCLUDE for the selection criteria specified in the question. If you used OUTFIL reporting functions, you can TOTal without having to limit the records you can count, and only have to extend by C'1', but then if you see Brian's COUNT you don't need to do it this way at all. – Bill Woodger Jan 30 '13 at 01:03