Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ommiting records using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: ommiting records using sort
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: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 16, 2008 10:14 pm    Post subject:
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

Site Director


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

PostPosted: Thu Oct 16, 2008 11:14 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Oct 17, 2008 12:05 am    Post subject:
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

Site Director


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

PostPosted: Fri Oct 17, 2008 12:41 am    Post subject: Reply to: ommiting records using sort
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 Moderator


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

PostPosted: Fri Oct 17, 2008 1:19 am    Post subject:
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

Site Director


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

PostPosted: Fri Oct 17, 2008 1:32 am    Post subject: Reply to: ommiting records using sort
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    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Oct 17, 2008 10:31 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Oct 17, 2008 10:44 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Fri Oct 17, 2008 3:22 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Fri Oct 17, 2008 3:31 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Fri Oct 17, 2008 5:08 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us