Posted: Thu Jul 08, 2010 7:54 am Post subject: Replace and Count.
Hi,
The input file (LRECL=25,RECFM=FB) is like this....
Code:
----+----1----+----2----+----3
REC01.....P.....S.....E
REC02.....P.....S.....E
REC39 ROSE MARY H.....S
REC44.....T.....L.....S
The "....." represent low values. I would like to replace all these low values with spaces and report those statistics (how many got replaced) in sysout.
Quote:
Field1 - 6th to 10th columns
Field2 - 12th to 16th columns
Field3 - 18th to 22nd columns
In above case, I should get the output like this..
Code:
No. of fileds with low-values for Field1 - 3
No. of fields replaced with spaces for Field1 - 3
***
No. of fileds with low-values for Field2 - 3
No. of fields replaced with spaces for Field2 - 3
***
No. of fileds with low-values for Field3 - 4
No. of fields replaced with spaces for Field3 - 4
***
Please help.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Jul 08, 2010 11:30 am Post subject:
mfu,
Your description is quite unclear.
Quote:
I would like to replace all these low values with spaces and report those statistics (how many got replaced) in sysout
Code:
No. of fileds with low-values for Field1 - 3
No. of fields replaced with spaces for Field1 - 3
I see 3 records with low values for Field1 in your example, not 3 fields (whatever that would mean).
You say "No. of fields", but it looks like you really want the "No. of records" ... right?
Does a field have either all low values or no low values? Or can it have mixed low values and non-low values? For example could field1 have something like:
ABC...
.A.B.C _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Sorry for the typo......yes. it is records and not fields. It will always have low-values only. They appear continuous and not like .A.B.C.
Kolusu, this file goes as input to another job also. We do a check and report those wrong values back to customer but want to proceed with data processing.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Fri Jul 09, 2010 2:07 am Post subject:
mf_user wrote:
We do a check and report those wrong values back to customer but want to proceed with data processing.
[PERSONAL OPINION ON]
unless you can charge the customer more, based on your error report,
or simply tell the customer you can not process his faulty input data
you are wasting your own resources keeping track of what is changed.
simply change the low-values to spaces prior to processing the file,
or modify the input portion of your process to accept low-values and change them at that point.
Unless you have the ability to apply consequences,
just modify the data,
and save your breath.
[PERSONAL OPINION OFF] _________________ Dick Brenholtz
American living in Varel, Germany
OUTFIL BUILD=(1,25)
OUTFIL FNAMES=REPORT,REMOVECC,NODETAIL,BUILD=(80X),
TRAILER1=('NO. OF RECORDS WITH LOW-VALUES FOR FIELD1 : ',
TOT=(26,1,ZD,M10,LENGTH=8),/,
'NO. OF RECORDS REPLACED WITH SPACES FOR FIELD1 : ',
TOT=(26,1,ZD,M10,LENGTH=8),/,
'***',/,
'NO. OF RECORDS WITH LOW-VALUES FOR FIELD2 : ',
TOT=(27,1,ZD,M10,LENGTH=8),/,
'NO. OF RECORDS REPLACED WITH SPACES FOR FIELD2 : ',
TOT=(27,1,ZD,M10,LENGTH=8),/,
'***',/,
'NO. OF RECORDS WITH LOW-VALUES FOR FIELD3 : ',
TOT=(28,1,ZD,M10,LENGTH=8),/,
'NO. OF RECORDS REPLACED WITH SPACES FOR FIELD3 : ',
TOT=(28,1,ZD,M10,LENGTH=8),/,
'***',80:X)
//*
Thanks a lot for your help _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 12, 2010 10:04 am Post subject:
mf_user wrote:
Hi,
I get the results into SYSOUT but not the report because job abends with S0C7 !
Thanks.
and we are supposed to solve it without looking at the job sysout or dump or the control cards you used? _________________ Kolusu
www.linkedin.com/in/kolusu
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum