Page 2 of 2

Re: COUNTING records based on group

PostPosted: Mon Oct 20, 2008 12:29 pm
by SANDHYA BUDHI
Hi frank ,

thank you for helping me in this ..

:D

Re: COUNTING records based on group

PostPosted: Mon Oct 20, 2008 5:46 pm
by SANDHYA BUDHI
Hi Frank,

My Input layout is

01 INPUT-REC.
05 DATE.
10 CC PIC 9(02).
10 YY PIC 9(02).
10 MM PIC 9(02).
10 DD PIC 9(02).
05 ERROR-CODE PIC 9(02).
05 ABC PIC S9(09).
05 DEF PIC X(11).
05 GHI PIC X(11).
05 JKL PIC X(01).
05 MNO PIC 9(09).
05 PQR PIC X(20).
05 STU PIC X(11).
05 VWX PIC X(01).
05 TOT-PROC PIC X(11).
05 ERROR-COUNT PIC 9(10).

I have given the value for TOT-PROC as 2 in the Input File. After the SORT is performed using the SORT mentioned above it is moving some JUNK values in the TOT-PROC.
The value is X'F240404040404040404040' for the TOT-PROC after the SORT.
In later stage I am using the field TOT-PROC for some Computational purposes. I am getting SOC7 because of this Junk values.

I am not able to do any computational process..

In the Input file I have given the value as 2. Will I able to get the same value after the SORT also for the Field TOT-PROC.

For the rest of the fields I am gettign the value what I have given in my Input File.

Please whether I am missing anything . Please help me in resolving this..

Re: COUNTING records based on group

PostPosted: Mon Oct 20, 2008 6:10 pm
by SANDHYA BUDHI
One more additional Information regarding the above Query ..

The TOT-PROC is defined as ZZZ,ZZZ,ZZ9.

Re: COUNTING records based on group

PostPosted: Mon Oct 20, 2008 8:54 pm
by Frank Yaeger
I have no idea what you're talking about. What do you mean by "the SORT mentioned above"? Which field is TOT-PROC in the control statements? If the input field contains X'F240....', that is NOT a ZD value - it's a UFF value.

Show an example of your input records and what you want for output. Explain the rules for getting from input to output. Give the starting position, length and format for each relevant field.

Re: COUNTING records based on group

PostPosted: Tue Oct 21, 2008 9:25 am
by SANDHYA BUDHI
My input file is

01 INPUT-REC.
05 DATE.
10 CC PIC 9(02).
10 YY PIC 9(02).
10 MM PIC 9(02).
10 DD PIC 9(02).
05 ERROR-CODE PIC 9(02).
05 ABC PIC S9(09).
05 DEF PIC X(11).
05 GHI PIC X(11).
05 JKL PIC X(01).
05 MNO PIC 9(09).
05 PQR PIC X(20).
05 STU PIC X(11).
05 VWX PIC X(01).
05 TOT-PROC PIC ZZZ,ZZZ,ZZ9.

My output file is

01 INPUT-REC.
05 DATE.
10 CC PIC 9(02).
10 YY PIC 9(02).
10 MM PIC 9(02).
10 DD PIC 9(02).
05 ERROR-CODE PIC 9(02).
05 ABC PIC S9(09).
05 DEF PIC X(11).
05 GHI PIC X(11).
05 JKL PIC X(01).
05 MNO PIC 9(09).
05 PQR PIC X(20).
05 STU PIC X(11).
05 VWX PIC X(01).
05 TOT-PROC PIC X(11).
05 Error-count PIC 9(09).

The sort card is given below:
OPTION ZDPRINT
INREC OVERLAY=(95:C'000000001')
SORT FIELDS=(11,9,ZD,A,9,2,ZD,A)
SUM FIELDS=(95,9,ZD)

Suppose say my input file is

20080810636363634634636363636336363636346363364363463663463636362

2 is the ToT-PROC

After doing the Sort using the above Sort card in my sort out I am getting

2008081063636363463463636363633636363634636336436346366346363636X'2f040404040000000002

In the output of the Sort I am getting X'2f04040404 as the TOT-PROC and 000000002 as my Error count.

The Error count is coming fine but the TOT-PROC has some invalid values so that in my downstream process I cant use it for computational purposes. It is giving me SOC7.

The output file should be

20080810636363634634636363636336363636346363364363463663463636362000000002

For the field TOT-PROC I should get the same value I have given in my Input.

In the Input file the field TOT-PROC is defined as ZZZ,ZZZ,ZZ9. Will that be a problem we are getting some invalid value in the SORT.

The position of the TOT-PROC is Start - 84, End- 94, Length -11.

Please I really requrie your help in solving this..

Re: COUNTING records based on group

PostPosted: Tue Oct 21, 2008 2:45 pm
by SANDHYA BUDHI
Hi,

Additional information ..

The TOT-PROC is not involved in the control cards but it is apart of my SORTOUT file and it is coming as some junk data X'2f04040404.. I need the data which I am giving as Input . Suppose If id give 2 in the Input file , I want the same data 2 in my output file also..

Re: COUNTING records based on group

PostPosted: Tue Oct 21, 2008 9:30 pm
by Frank Yaeger
Please I really requrie your help in solving this..


I'd like to help, but what you're saying makes no sense.

The control cards you show would NOT change the value in positions 84-94. They would give the same TOT-PROC data in output as for input.

INREC OVERLAY=(95:C'000000001')

Puts '000000001' in 95-103. OVERLAY does NOT change any other data.

SORT FIELDS=(11,9,ZD,A,9,2,ZD,A)

Does a SORT on the positions specified - SORT does NOT change any data.

SUM FIELDS=(95,9,ZD)

Does a SUM on 95-103 - only changes 95-103 - SUM does NOT change any other data.

So either your input value was junk to begin with or you're doing something you're not telling us about.

Re: COUNTING records based on group

PostPosted: Thu Oct 30, 2008 1:29 pm
by SANDHYA BUDHI
Hi frank,

There was a problem in the Input file data provided. That is the reason it was giving invalid values in the SORTOUT for the field TOT-PROC . Using the corrected file I ran the SORT card

OPTION ZDPRINT
INREC OVERLAY=(95:C'000000001')
SORT FIELDS=(11,9,ZD,A,9,2,ZD,A)
SUM FIELDS=(95,9,ZD)

and it is working fine.. Thanks for your great help.