MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

eliminate non alphanumeric & numeric data..

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Wed Jul 16, 2003 3:09 pm    Post subject: eliminate non alphanumeric & numeric data.. Reply with quote

Hi.

I have file of 80 lrec.. and I want the data having only either A-B OR 0-9 in one file and remaining data in other file.. Can you suggest some sort utility ..if possible canyou paste here..

Thanks
Anand
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jul 16, 2003 4:15 pm    Post subject: Reply with quote

Anand,

I'm not sure what you mean by "the data having only either A-B or 0-9", but I'll assume you mean data having A-B or 0-9 in some particular position in the file - let's say in position 11. Here's an example of how to do that with DFSORT:

Code:

//S1   EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file with A, B and 0-9
//OUT2 DD DSN=...    output file with rest
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,
    INCLUDE=(11,1,SS,EQ,C'AB0123456789')
  OUTFIL FNAMES=OUT2,SAVE
/*



If that's not what you want to do, then please clarify. A sample of your input and what you want for the output would help.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Wed Jul 23, 2003 1:53 pm    Post subject: Reply with quote

Frank.

Sorry for the confusion.. I want the non numeric or non alphanumeric data into separate file.

For instance

Input file : THIS IS GOOD DATA 126543
THIS IS BAD$#@DATA87698



I need two output files

first file should have : THIS IS GOOD DATA 126543

Because this data contains only numeric(0-9) and alpha numeric(A-Z).

And
Second file should have : THIS IS BAD$#@DATA87698

Because this data contains some special characters(%)..

Please let me know is it possible?

Thanks
Anand
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jul 23, 2003 3:00 pm    Post subject: Reply with quote

Anand,

So if I understand correctly, you want the records that contain any character other than blank, A-Z or 0-9 anywhere from positions 1-80 in the BAD file, and records that contain only blank, A-Z or 0-9 in all characters in the GOOD file. That's a little harder than the original request, but this DFSORT job will do it:

Code:

//S1   EXEC  PGM=ICEMAN                           
//SYMNAMES DD *                                   
CHK,C' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'       
B01,1,1                                           
B02,*,1                                           
B03,*,1                                           
B04,*,1                                           
B05,*,1                                           
B06,*,1                                           
B07,*,1                                           
B08,*,1                                           
B09,*,1                                           
B10,*,1                                           
B11,*,1                                           
B12,*,1                                           
B13,*,1                                           
...  continue with B14 to B80                                   
B80,*,1                                                         
//SYSOUT    DD SYSOUT=*                                         
//SORTIN DD *                                                   
THIS IS GOOD DATA 126543                                       
THIS IS BAD$#@DATA87698                                         
//BAD DD SYSOUT=*                                               
//GOOD DD SYSOUT=*                                             
//SYSIN    DD    *                                             
  OPTION COPY                                                   
  OUTFIL FNAMES=BAD,                                           
   INCLUDE=(B01,SS,NE,CHK,OR,B02,SS,NE,CHK,OR,B03,SS,NE,CHK,OR, 
            B04,SS,NE,CHK,OR,B05,SS,NE,CHK,OR,B06,SS,NE,CHK,OR, 
            B07,SS,NE,CHK,OR,B08,SS,NE,CHK,OR,B09,SS,NE,CHK,OR, 
            B10,SS,NE,CHK,OR,B11,SS,NE,CHK,OR,B12,SS,NE,CHK,OR, 
            B13,SS,NE,CHK, ... continue with B14 to B79         
            B80,SS,NE,CHK)                                       
  OUTFIL FNAMES=GOOD,SAVE                                       
/*                                                               

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Jul 31, 2003 1:39 pm    Post subject: Reply with quote

Frank,

I am getting u0016 error.. outfil statment syntax error.

here is my jcl. I am just doing testing for columns 12,13,14 in the file..

//G1NX62TE JOB (CEFD-CEFTSOU,020),'ICEMAN',CLASS=X,
// MSGCLASS=X,NOTIFY=G1NX62T
//S1 EXEC PGM=ICEMAN
//SYMNAMES DD *
CHK,C' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
B01,12,1
B02,*,1
B03,*,1
//SYSOUT DD SYSOUT=*
//SORTIN DD *
THIS IS GOOD DATA 126543
THIS IS BAD$#@DATA87698
//BAD DD SYSOUT=*
//GOOD DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=BAD,
INCLUDE=(B01,SS,NE,CHK,OR,B02,SS,NE,CHK,OR,B03,SS,NE,CHK)
OUTFIL FNAMES=GOOD,SAVE
/*


Error description is :

SYSIN :
OPTION COPY
OUTFIL FNAMES=BAD,
INCLUDE=(B01,SS,NE,CHK,OR,B02,SS,NE,CHK,OR,B03,SS,NE,CHK)
*
OUTFIL FNAMES=GOOD,SAVE
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

Please let me know..

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 31, 2003 2:41 pm    Post subject: Reply with quote

Anand,

Based on your error messages(WER....) it is evident that you have syncsort at your shop. Syncsort does not support the use of symbols like DFSORT does. so try the following JCl.

Code:

//STEP10 EXEC PGM=SORT                                             
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD *                                                       
THIS IS GOOD DATA 126543                                           
THIS IS BAD$#@DATA87698                                             
//BAD    DD SYSOUT=*                                               
//GOOD   DD SYSOUT=*                                               
//SYSIN  DD *                                                       
 SORT FIELDS=COPY                                                   
  OUTFIL FNAMES=GOOD,                                               
  INCLUDE=(12,1,SS,EQ,C' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',AND,
           13,1,SS,EQ,C' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',AND,
           14,1,SS,EQ,C' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')     
  OUTFIL FNAMES=BAD,SAVE                                             
/*                                                                 


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Jul 31, 2003 3:57 pm    Post subject: Reply with quote

Thanks Kolusu and Frank

Kolusu
..you are right/great.. we don't have DFSORT in our shop...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group