IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ommiting records using sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Thu Oct 16, 2008 10:11 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 16, 2008 10:14 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 16, 2008 11:14 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Oct 17, 2008 12:05 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 17, 2008 12:41 am
Reply with quote

Hi Garry,

Good catch icon_wink.gif

I was so busy reading the text that i didn't even look at the syntax icon_redface.gif

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 17, 2008 1:19 am
Reply with quote

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. icon_wink.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 17, 2008 1:32 am
Reply with quote

Actually, my built-in syntax-checker did not raise an alarm. . . heh heh heh icon_rolleyes.gif

So, then i replied to the text only.

Then came the "Catch" and i was like "Oh, Yeah" how'd i miss that icon_wink.gif

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
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri Oct 17, 2008 10:20 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 17, 2008 10:31 am
Reply with quote

Hi,

I think you will find 256 is the max you can use.


Gerry
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri Oct 17, 2008 10:40 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 17, 2008 10:44 am
Reply with quote

Hi,

try something like this
Code:
  OMIT COND=(01,256,CH,EQ,C' ',&,257,44,CH,EQ,C' ')




Gerry
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri Oct 17, 2008 11:08 am
Reply with quote

thank you this works...can we give multiple '&' conditions like this because i have lrecl upto 32000
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 17, 2008 3:22 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Oct 17, 2008 3:31 pm
Reply with quote

Hi Gerry,

Is it possible till 32000 which the TS has asked?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Oct 17, 2008 5:08 pm
Reply with quote

I ran a test with LRECL=32000 and it worked fine with 125 OMIT conditions. I suspect it can accommodate more.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top