Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
sort card to seperate numeric,alphabetic and alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: sort card to seperate numeric,alphabetic and alphanumeric
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

Site Director


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

PostPosted: Fri Apr 11, 2008 12:42 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Apr 11, 2008 8:51 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Apr 11, 2008 10:49 pm    Post subject:
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

Site Director


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

PostPosted: Fri Apr 11, 2008 11:33 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Apr 12, 2008 1:08 am    Post subject:
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    Post subject:
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    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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us