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
 

 

counting the non-blank characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Tue May 29, 2007 7:19 pm    Post subject: counting the non-blank characters
Reply with quote

May I know how to count the number of non-blank characters in a particular column of file....

Means Let us suppose we have blanks and non-blanks in column 10...then how to count all non-blank characters in column 10 using F ALL command or any command is there...

1. it should count only alphabets.
2. it should count only numerics.

Regards,
pavan
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue May 29, 2007 7:25 pm    Post subject:
Reply with quote

Intrigued, why would you want to do this ???
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue May 29, 2007 8:32 pm    Post subject:
Reply with quote

try this code
Code:
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
111111111 111111.....11111                                             
2222222222222222.....22222                                             
333333333 333333.....33333                                             
4444444444444444.....44444                                             
/*                                                                     
//NUM       DD SYSOUT=*                                                 
//NONNUM   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  TO(NUM) USING(CP01)                                   
 COPY FROM(IN1)  TO(NONNUM) USING(CP02)                                 
/*                                                                     
//CP01CNTL DD   *                                                       
  INCLUDE COND=(10,1,CH,EQ,NUM,AND,10,1,CH,NE,' ')                     
  OUTFIL NODETAIL,REMOVECC,                                             
  TRAILER1=(COUNT=(M11,LENGTH=8))                                       
/*                                                                     
//CP02CNTL DD   *                                                       
  INCLUDE COND=(10,1,CH,NE,NUM,AND,10,1,CH,NE,' ')                     
  OUTFIL NODETAIL,REMOVECC,                                             
  TRAILER1=(COUNT=(M11,LENGTH=8))                                       
/*                                                                     
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: Tue May 29, 2007 9:33 pm    Post subject:
Reply with quote

pavan,

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

Code:

//S1       EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
        <A>
        < >
        <2>
        < >
        <4>
        <B>
        <C>
/*
//NUM      DD SYSOUT=*
//ALPHA    DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INCLUDE COND=(10,1,CH,NE,C' ')
  OUTFIL FNAMES=NUM,NODETAIL,REMOVECC,
    INCLUDE=(10,1,FS,EQ,NUM),
    TRAILER1=(COUNT=(M11,LENGTH=8))
  OUTFIL FNAMES=ALPHA,NODETAIL,REMOVECC,
    SAVE,
    TRAILER1=(COUNT=(M11,LENGTH=8))
/*


NUM would have:

00000002

and ALPHA would have:

00000003

You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's NUM function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

If you can't use NUM, you could use this instead:

Code:

    INCLUDE=(10,1,SS,EQ,C'0123456789'),
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: Tue May 29, 2007 9:33 pm    Post subject:
Reply with quote

krisprems,

Why would you think you need to do this in two passes?

And if you had tested your "solution" you would have realized that 10,1,CH,EQ,NUM is invalid.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue May 29, 2007 11:55 pm    Post subject:
Reply with quote

You can use the picture option of the find command, if you use ISPF editor:
P'='
Any character
P'?'
Any character that is not a blank
P'.'
Any character that cannot be displayed
P'#'
Any numeric character, 0-9
P'-'
Any non-numeric character
P'@'
Any alphabetic character, uppercase or lowercase
P'<'
Any lowercase alphabetic character
P'>'
Any uppercase alphabetic character
P'$'
Any special character, neither alphabetic nor numeric.

For example, if you want to count the number of rows containing numeric characters at column 10, you should use the following command: FIND ALL P'#' 10 10. The number of matched rows will be displayed as a short message (usually at the upper right corner of the screen).

O.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Trasnmitting a file with french chara... spoorni IBM Tools 1 Wed Feb 24, 2016 8:13 pm
No new posts FTP of french characters in a txt fil... naresh54 IBM Tools 2 Thu Nov 12, 2015 8:12 am
No new posts OVERLAY several fields if non-blank autobox DFSORT/ICETOOL 5 Fri Jul 10, 2015 12:42 pm
No new posts Easytrieve Report: Advanced blank Lin... Raj Vatsav CA Products 6 Mon Jul 06, 2015 2:59 pm


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