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

can we check if a field is alphanumeric??


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

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Thu Dec 13, 2007 6:08 pm
Reply with quote

Hi,

Can some one help me with the following requirement.

I have a fileand it has a two fields EMP_NAME and EMP_ID

The EMP_ID is alpha numeric and it is of 7 characters.

The requirement is like i need to create a list of employees where the EMP_ID has the invalid values.

The invalid values are values other than A-Z and 0-9.

Can we check if a field is alpha numeric, numeric usinf DFSORT.

I would be great if some one help me in this..

Thanks,
Dharani
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Thu Dec 13, 2007 7:16 pm
Reply with quote

sorry..couldn't come up with anything other than this..

Code:

  SORT FIELDS=COPY                                           
  INCLUDE COND=((1,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (2,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (3,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (4,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (5,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (6,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (7,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),OR,
              (1,7,FS,EQ,NUM))


Just check whether it s working...
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 7:50 pm
Reply with quote

Except that will consider a numeric or ALPHANUMERIC as being invalid. I think you need to remove the "or (1,7,fs,eq,num)" and change the others to include 0 thru 9 "(?,1,SS,NE,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'),".
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Thu Dec 13, 2007 7:54 pm
Reply with quote

thanks for correcting that craq... icon_smile.gif
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: Thu Dec 13, 2007 11:17 pm
Reply with quote

Dharani,

Assuming that EMP_ID is in positions 1-7, here's a DFSORT job that will do what you asked for. You can change the positions if appropriate.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
CHECK,'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE FORMAT=SS,
    COND=(1,1,NE,CHECK,OR,
          2,1,NE,CHECK,OR,
          3,1,NE,CHECK,OR,
          4,1,NE,CHECK,OR,
          5,1,NE,CHECK,OR,
          6,1,NE,CHECK,OR,
          7,1,NE,CHECK)
/*
Back to top
View user's profile Send private message
nagarajan.dharani

New User


Joined: 27 Dec 2006
Posts: 36
Location: Chennai

PostPosted: Wed Dec 19, 2007 1:50 pm
Reply with quote

Hi all,

Thanks a lot for you help...

Frank, it had worked fine for me. Thanks a lot for your help.

Dharani
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to check whether who renamed the ... JCL & VSAM 3
Search our Forums:

Back to Top