View previous topic :: View next topic
|
Author |
Message |
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you use INCLUDE rather than OMIT you should get a file of those records. |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|