MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

to find the Loc

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
tattva
Beginner


Joined: 02 Feb 2005
Posts: 97
Topics: 36

PostPosted: Mon Feb 14, 2005 4:11 am    Post subject: to find the Loc Reply with quote

Hi Guys,

Before i start writing the problem , let me tell u all that i am beginner in REXX.

Problem Description :- i have to find the Loc of cobol program

Loc = total lines - ( comments ) - (blank lines)

This is exactly what i want !!

can u guys give me the code snippet

TIA
------

tattva
Back to top
View user's profile Send private message
s_shivaraj
Beginner


Joined: 21 Sep 2004
Posts: 140
Topics: 14
Location: Chennai, India

PostPosted: Mon Feb 14, 2005 6:04 am    Post subject: Reply with quote

Hi tattva,
Here is the code for U.. Hope it helps you

Quote:
/* REXX */
"ALLOC DA(unquali.file.name) F(INDD) SHR REUSE"
RC = 0
LINENO = 0
DO WHILE RC = 0
"EXECIO 1 DISKR INDD"
IF RC = 0 THEN /* Record was read */
DO
PULL RECORD
IF ((SUBSTR(RECORD,7,1) ) <>'*') THEN
if space(record,0) <> ' 'then
lineno = lineno + 1 /* Count the record */
else Nop
else Nop
END
END
say lineno

_________________
Cheers
Sivaraj S

'Technical Skill is the Master of complexity, while Creativity is the Master of Simplicity'
Back to top
View user's profile Send private message AIM Address
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon Feb 14, 2005 8:52 am    Post subject: Reply with quote

Or use SORT with SYSIN as:

Code:

//SYSIN DD *
 OPTION COPY
 OMIT COND=(7,1,CH,EQ,C'*', &, Omit comments
                      8,65,CH,EQ,C' ')    Omit blank lines
/*

_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon Feb 14, 2005 8:54 am    Post subject: Reply with quote

The instream data for SYSIN must begin from 2nd column atleast. I did not copy paste from my mainframe session; I typed here. So, perhaps, the leading space got lost.

In any case, the instream data for SYSIN must begin from 2nd column atleast.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group