View previous topic :: View next topic
Author
Message
malathy_tv New User Joined: 29 May 2007Posts: 34 Location: chennai
hi,
i need to omit records having spaces using sort and i used
Code:
SORT FIELDS=(1,142,CH,A)
SUM FIELDS=NONE
OMIT COND=(26,99,CH,EQ,C' ')
this failed due to U016 beacuse i input file had some characters which seems to be like spaces but when we put F P'.' we are abelt o view it like
Code:
0998000637480500001
FFFFFFFFFFFFFFFFFFF444444444444444444444444444
0998000637480500001000000000000000000000000000
----------------------------------------------
0998000637480500001 UAmendment Defi
FFFFFFFFFFFFFFFFFFF4444444444EC9898989A434C888
0998000637480500001000000000041455445530604569
so this one abends on reading those characters.
then how do we sort this type of records
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
The reason for failure need not be that, and unless you post the error messages and codes issued then nobody will be able to help you.
also, RECFM= LRECL= might come in handy too
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
so this one abends on reading those characters.
Why would you believe the abend was due to "those characters"? You have named character data, so all 256 values are valid. . .
As Expat said, you need to post the diagnostic info from the execution that failed.
Back to top
Garry Carroll Senior Member Joined: 08 May 2006Posts: 1193 Location: Dublin, Ireland
Quote:
Code:
SORT FIELDS=(1,142,CH,A)
SUM FIELDS=NONE
OMIT COND=(26,99,CH,EQ,C' ')
If a 99byte field starting in position 26 is a 1-character blank? That looks like a good candidate for a bad return code.
Garry.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hi Garry,
Good catch
I was so busy reading the text that i didn't even look at the syntax
d
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
OMIT COND=(26,99,CH,EQ,C' ')
If a 99byte field starting in position 26 is a 1-character blank? That looks like a good candidate for a bad return code.
Nope. You're misinterpreting the syntax. It's correct.
That OMIT statement actually checks the 99 characters for ALL blanks. When the field length is greater than the constant length, the constant is padded with blanks on the right to the field length. So in this case, the constant actually represents 99 blanks.
This would NOT cause a bad return code.
Quote:
Good catch
I was so busy reading the text that i didn't even look at the syntax
Now you can be doubly embarrassed.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Actually, my built-in syntax-checker did not raise an alarm. . . heh heh heh
So, then i replied to the text only.
Then came the "Catch" and i was like "Oh, Yeah" how'd i miss that
Then came the "Clarification" and i was like "Oh, Spit".
Quote:
Now you can be doubly embarrassed.
At least. . .
Wonder how much more of my foot i can get in my mouth before we actually see what caused the error(s). . .
d
Back to top
malathy_tv New User Joined: 29 May 2007Posts: 34 Location: chennai
My jcl is like
Code:
//STEP5 EXEC PGM=SORT
//SORTIN DD DSN=NAAAFG.ST.SCHD.OUTFILE.G0015,DISP=SHR
//SORTOUT DD DSN=NAAAFG.ST.SCHDITEM.OUT,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=343),
// VOL=(,,,10),
// SPACE=(CYL,(1000,1000),RLSE)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,343,CH,A)
SUM FIELDS=NONE
OMIT COND=(26,300,CH,EQ,C' ')
//*
and the abend looks like
Code:
SYSIN :
SORT FIELDS=(1,343,CH,A)
SUM FIELDS=NONE
OMIT COND=(26,300,CH,EQ,C' ')
*
WER251A INCLUDE/OMIT INVALID LENGTH
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
but the length everything is correct
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
I think you will find 256 is the max you can use.
Gerry
Back to top
malathy_tv New User Joined: 29 May 2007Posts: 34 Location: chennai
Yes this goes fine if i give till 256 but i have different files which needs to be sorted like this and those have lrecls upto 32000 (the max) in that case how to achive this
please let me know your ideas.
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
try something like this
Code:
OMIT COND=(01,256,CH,EQ,C' ',&,257,44,CH,EQ,C' ')
Gerry
Back to top
malathy_tv New User Joined: 29 May 2007Posts: 34 Location: chennai
thank you this works...can we give multiple '&' conditions like this because i have lrecl upto 32000
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
yes you can
eg.
Code:
OMIT COND=(001,256,CH,EQ,C' ',&,
257,044,CH,EQ,C' ',&,
301,010,CH,EQ,C' ',&,
311,010,CH,EQ,C' ')
Gerry
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Hi Gerry,
Is it possible till 32000 which the TS has asked?
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
I ran a test with LRECL=32000 and it worked fine with 125 OMIT conditions. I suspect it can accommodate more.
Back to top
Please enable JavaScript!