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

Sort card to identify special characters


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed May 14, 2008 12:47 pm
Reply with quote

have a data set which contains names only. some of the names have special characters embedded in the data. Need a sort card to eliminate/identify the records with special characters.
for reference i have given few names below
BIXENTA
BL`R
BL`THAN
BLADE
BLAINE
BLAIR
BLAISE
BLAKE

Thaks
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed May 14, 2008 1:57 pm
Reply with quote

Please check the below example and modify as per your requirement
Code:
//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *             
BIXENTA                     
BL`R                         
BL`THAN                     
BLADE                       
BLAINE                       
BLAIR                       
BLAISE                       
BLAKE                       
/*                           
//SORTOUT  DD SYSOUT=*       
//SYSIN    DD *             
  OPTION COPY               
  OMIT COND=(1,10,SS,EQ,C'`')
//*                         
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed May 14, 2008 3:55 pm
Reply with quote

hi,
i think it will not work..coz the problem is these special charecters
can be anywhere inside the name.its position is not fixed and also
it can be anyspecial charecter not necessarily a " ' " .i hope you
got my requirement..if position is not fixed then how we can
do it in a sort card.may be using cobol we can do it.but i have to
do it using a sort card..is there a way
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed May 14, 2008 4:50 pm
Reply with quote

1. The solution that i have provided, checks for the character ` anywhere in first 10 characters.
2. Do you have the possible set of Junk characters , If you know the possible set of Junk characters you can try
Code:
//STEP0100 EXEC PGM=SORT       
//SYSOUT   DD SYSOUT=*         
//SORTIN   DD *               
BIXENTA                       
BL`R                           
BL`THAN                       
BLADE                         
BL&INE                         
BLAIR                         
BLA*SE                         
BLAKE                         
/*                             
//SORTOUT  DD SYSOUT=*         
//SYSIN    DD *               
  OPTION COPY                 
  OMIT COND=(1,10,SS,EQ,C'*',|,
             1,10,SS,EQ,C'`',|,
             1,10,SS,EQ,C'&') 
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: Wed May 14, 2008 8:13 pm
Reply with quote

Hello,

Do you really want to discard all of the records containing some unwanted special character? Seems like those would still be good/valid records - they just have some character(s) that not acceptable in the file/data.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Thu May 15, 2008 11:23 am
Reply with quote

Hi dick,
you are right.I just want to identify the records in a separate file which
have the names with special charecter.
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 May 15, 2008 11:27 am
Reply with quote

Hello,

If you use INCLUDE rather than OMIT you should get a file of those records.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Fri May 16, 2008 3:01 pm
Reply with quote

dick write
Quote:
Do you really want to discard all of the records containing some unwanted special character? Seems like those would still be good/valid records - they just have some character(s) that not acceptable in the file/data


can u pls suggest me how to discard only those unwanted charecters.
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 May 16, 2008 7:10 pm
Reply with quote

Hello,

Quote:
how to discard only those unwanted charectrs
Demonstrate this "discard" in some example data. Your previous post said you wanted these records in a separate file.

Please re-post your complete requirement including some input data and the output(s) you want from that data. The topic appears to have gone in multiple directions.

Once we get things straight, i'll go back and remove the unneeded posts.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Fri May 16, 2008 9:14 pm
Reply with quote

Code:
//STEP0100 EXEC PGM=SORT       
//SYSOUT   DD SYSOUT=*         
//SORTIN   DD *               
BIXENTA                       
BL`R                           
BL`THAN                       
BLADE                         
BL&INE                         
BLAIR                         
BLA*SE                         
BLAKE                         
/*                             
//OUT1        DD DSN=HLQ.ONLY.SPECCHAR,DISP=.......
//OUT2        DD DSN=HLQ.NO.SPEC.CHAR,DISP=.......
//SYSIN    DD *               
  OPTION COPY
  OUTFIL FNAMES=OUT1,                 
             INCLUDE=(1,10,SS,EQ,C'*',or,
             1,10,SS,EQ,C'`',or,
             1,10,SS,EQ,C'&') 

  OUTFIL FNAMES=OUT2,SAVE               
/*
In the jcl, only those records that have either of three special characters anywhere in the first 10 bytes in the record will be written to OUT1 file i.e
HLQ.ONLY.SPECCHAR.
THe records that don't contain the above three special chars will be written to OUT2 file i.e HLQ.NO.SPEC.CHAR.


-Ajay
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: Sat May 17, 2008 12:03 am
Reply with quote

Hello,

The posted "code" does not address this:
Quote:
can u pls suggest me how to discard only those unwanted charecters.
Once a proper requirement definition has been posted, we can better offer suggestions.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top