Joined: 30 Jun 2009 Posts: 15 Location: Missouri, USA
Looks like I'm missing something important about selectively clearing out one field based on the content of another field (on the incoming side - so the sort will work with the changed field's value).
Generically - Here's what I want to do:
-- Make the contents of field "A" all spaces only for records which have a given code value in another field "B".
-- Then use that sometimes spaced-out field as one of the "ON" fields in a situation where I am using VALCNT - so all record occurrences with the spaced-out amount are counted as records having other (non-changed) values would be.
Unfortunately I'm running into a S0C7, so I'm almost certain I don't understand something correctly after sifting through several manuals/help books (I think a key concept has just gone by me).
Joined: 30 Jun 2009 Posts: 15 Location: Missouri, USA
Oops - I just realized I forgot to include samples of the input record occurrences:
Sort of like "header lines" at top of the file: (leftwise)
Code:
BROWSE TCR.R760.CV016.SUPCRECL Line 00000000 Col 001 132
Command ===> Scroll ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3-
*********************************************************** Top of Data ***********************************************************
PROGRAM ~VE~RECORD-NAME ~1ST-16-DISPLAYBL~1ST-16-BYTES-IN-HEXADECIMAL ~T~CHGD~ USERID ~RUN-UNIT-#~PAGE-NUMBR:LINE~R~JRNL-SE
NAME ~RB~ ~OR-SET-IF-CONECT~.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6~Y~OFST~(W/EXIT)~ ~FROM-DBKEY:INDX~3~(INTERN
--------~--~----------------~----------------~--------------------------------~-~----~--------~----------~----------:----~-~-------
Leftwise columns (of somewhat representative lines down into file):
BROWSE TCR.R760.CV016.SUPCRECL Line 00000000 Col 133 264
Command ===> Scroll ===> CSR
--+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6---
*********************************************************** Top of Data ***********************************************************
NC~V_VIASET-OWN-DBK~D~C_CH-SET-OWN-DBK~T~TIME ~SECS-B~TASKNAME~PAGE~DML-V~UPD-DATE~TERMINAL~C~NEW-CHANGED-DBK~ORIG-CHNGD-DBKY~DDNA
L)~T_WHN-VIA-RECORD~P~T_OR-SEGMENT>102~G~HHMMSS~MMMMMM~OR-JOBNM~GRUP~UPDTE~CCYYMMDD~(W/EXIT)~P~OR-DA-17-31-DIS~OR-DA-17-23-HEX~4-RE
--~----------------~-~----------------~-~------~------~--------~----~-----~--------~--------~-~---------------~---------------~----
Columns more to the right for same lines as above (down into file) :
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Dennis1SOIL,
You are overriding the DFSORT statements passed by ICETOOL for OCCURS operator which is NOT recommended.
From the documentation
You must NOT supply your own DFSORT MODS, INREC, OUTREC, SUM, or RECORD statement, because they override the DFSORT statements passed by ICETOOL for this operator.
Joined: 30 Jun 2009 Posts: 15 Location: Missouri, USA
Thanks Skolusu,
Yes, I made the changes you mentioned and it does give me the report I want!
However, (pesky me) -- By doing the COPY first, I think I'm basically going around one of the main reasons I want to use a SORT related utility (i.e. rather than maybe writing some exit code in a customized program).
This input file (and another similar to it) has the potential of containing many millions of record occurrences. I was thinking I could take advantage of the expertise you guys on the SORT team have shown - as SORT does such a good job of dealing with big file processing. My line of thought is like this: I think the INREC can shrink down the size of each record occurrence going into the SORT, so instead of 300 (or more) bytes, each record might be less than 60 or so (given that only the fields for the report need be going into the sort). So maybe an INREC statement could provide a way to get around the need to make another full size copy of the file (i.e. //TEMP file)?
The nice thing I've been hoping to achieve by using the OCCURS with ICETOOL is the ease in producing quick reports - along with being able to have all break type of sort fields appear on the same report line (rather than what I think I would get by default if I were to use something like SUM FIELDS= and BTITLE breaks - without using ICETOOL).
I'll try to get some time tomorrow to be more clear - but at this point before calling it a day I mainly just wanted to say thanks for your help so far!
(I suspect there is a relatively easy way - I'm probably just somehow overlooking it now - to end up both replacing the contents of a field based on the content of another field AND passing SORT much smaller records (i.e. only the fields used in the report) -- while still being able to come up with a relatively simple report to show counts of the number of records occurrences which contining the unique field values at each breakpoint in the sort <take breath here> ...and avoid the need writing and reading a temp file sized as big as the main input file. )
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Dennis1SOIL,
You can do reporting using regular SORT in one pass using OUTFIL reporting features and you have to do all the formatting and headers all by your self where as ICETOOL DISPLAY/OCCURS operators makes it easier.