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

sort card to seperate numeric,alphabetic and alphanumeric


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Fri Apr 11, 2008 11:12 am
Reply with quote

Hi,

I have one inputfile

Code:
Input:-
field1
abcde
bacd1
12345
33333
aaaaa


Here my requirement is I have to check if the data in the field1 is alphabetic, numeric or alphanumeric accordingly I have to separate them into 3 dataset

Code:
Output should look like:
3 outputs:-
alphabetic.dataset:-
abcde
aaaaa

alphanumeric.dataset:-
bacd1

numeric.dataset:-
12345
33333


Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 11, 2008 12:42 pm
Reply with quote

Hello,

Please post some more info.

Is the data only in the first 5 positions of the records?

What is the recfm and lrecl of the input file?

What about lower-case letters?

Any other info you know of that is needed for a solution?
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Fri Apr 11, 2008 4:50 pm
Reply with quote

Hi Dick,

Input file is of record length=80 and recfm=f

Code:
Is the data only in the first 5 positions of the records?

Yes Input file is having data only in the first 5 positions and remaining 75 bytes is blank space.

Code:
What about lower-case letters?

As an example I gave those input data. Whether it is lower or upper case in the output is not going to matter, only thing is I need to separate input on alphabetic, numeric and alphanumeric bases

All three output file is of record length=80 and recfm=f

hope I have provided required information if not please let me know.

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 11, 2008 8:51 pm
Reply with quote

Hello,

Quote:
Whether it is lower or upper case in the output is not going to matter
Should lower-case characters be written to the alphabetic output or the alphanumeric output?
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: Fri Apr 11, 2008 10:49 pm
Reply with quote

roopannamdhari,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//ALPHA DD DSN=...  output file1 (FB/80)
//NUM DD DSN=...    output file2 (FB/80)
//ALPHANUM DD DSN=...  output file3 (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'AAAAA')),
    IFTHEN=(WHEN=(1,1,FS,EQ,NUM),OVERLAY=(81:C'N'),HIT=NEXT),
    IFTHEN=(WHEN=(2,1,FS,EQ,NUM),OVERLAY=(82:C'N'),HIT=NEXT),
    IFTHEN=(WHEN=(3,1,FS,EQ,NUM),OVERLAY=(83:C'N'),HIT=NEXT),
    IFTHEN=(WHEN=(4,1,FS,EQ,NUM),OVERLAY=(84:C'N'),HIT=NEXT),
    IFTHEN=(WHEN=(5,1,FS,EQ,NUM),OVERLAY=(85:C'N'))
  OUTFIL FNAMES=ALPHA,INCLUDE=(81,5,CH,EQ,C'AAAAA'),BUILD=(1,80)
  OUTFIL FNAMES=NUM,INCLUDE=(81,5,CH,EQ,C'NNNNN'),BUILD=(1,80)
  OUTFIL FNAMES=ALPHANUM,SAVE,BUILD=(1,80)
/*


Dick,

Quote:
Should lower-case characters be written to the alphabetic output or the alphanumeric output?


If the value has all numerics, it goes to NUM. If the value has all non-numerics, it goes to ALPHA. Otherwise (mixed numeric and non-numeric), it goes to ALPHANUM. Lower case is just a non-numeric like anything else that is not 0-9.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 11, 2008 11:33 pm
Reply with quote

Hi Frank,

Yup, that is what i expected ICEMAN to do.

From the original post, i read it a bit differently: A-Z = alpha, 0-9 = numeric, and the "rest" = a/n. I was just unsure where l/c should go (if any would even be in the input).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Apr 12, 2008 1:08 am
Reply with quote

Frank Yaeger wrote:
If the value has all numerics, it goes to NUM. If the value has all non-numerics, it goes to ALPHA. Otherwise (mixed numeric and non-numeric), it goes to ALPHANUM. Lower case is just a non-numeric like anything else that is not 0-9.
Great, I would have been struggling with a long series of outrec includes and treated even the special characters and unprintables as alpha too.....
It takes a master to code that sweetly......
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Mon Apr 14, 2008 10:35 am
Reply with quote

thanks Frank Yaeger your Dfsort job working fine....

thanks to all....
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top