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
 

 

can we check if a field is alphanumeric??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: can we check if a field is alphanumeric??
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

thanks for correcting that craq... icon_smile.gif
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: Thu Dec 13, 2007 11:17 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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