View previous topic :: View next topic
Author
Message
nagarajan.dharani New User Joined: 27 Dec 2006Posts: 36 Location: Chennai
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
raak Active User Joined: 23 May 2006Posts: 166 Location: chennai
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
Craq Giegerich Senior Member Joined: 19 May 2007Posts: 1512 Location: Virginia, USA
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
raak Active User Joined: 23 May 2006Posts: 166 Location: chennai
thanks for correcting that craq...
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
nagarajan.dharani New User Joined: 27 Dec 2006Posts: 36 Location: Chennai
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
Please enable JavaScript!