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

finding the length of records in the dataset in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Wed Jul 01, 2009 5:55 pm
Reply with quote

Please let me know how it is possible to find out the length of the records present in the flat file.

I have tried using LENGTH condition but couldn't reach to solution.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 01, 2009 6:00 pm
Reply with quote

Can we presume that you're NOT looking to determine the dataset's LRECL? If so, what do you consider to be the "length of records"? The REXX LENGTH function would return the length of a given string. If that string was an entire record, then using that function should work for you.
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Wed Jul 01, 2009 6:05 pm
Reply with quote

I want to know know the number of characters of the record not the LRECL.

For example: a dataset whose LRECL is 80 and have records present in it is "ABCD".
So i want to know the number of character of record which is 4.

It would be helpful to me if you can give an example for using the LENGTH condition for the problem stated.

Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 01, 2009 6:13 pm
Reply with quote

in the manual, look at the STRIP function.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 6:13 pm
Reply with quote

I can see no reason why the length function does not give you what you want.

I have used it myself in the past for the very same reason and experienced no problems.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 01, 2009 6:34 pm
Reply with quote

expat,

length will give him the 80.
he wants to remove trailing spaces, and only count char (> space)
(yes, his wording was characteristic of this site,
thus making his requirement rather difficult to understand).

that's why i suggested that he incorporate the STRIP function.
otherwise, I have no idea what the TS wants - (other than the code).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 7:01 pm
Reply with quote

dbz,

Mmmmmmmm, another case of further posts added while I was
a) typing my reply
b) interupted from (a) by work icon_confused.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jul 01, 2009 7:14 pm
Reply with quote

You are both right! Use LENGTH and STRIP.
Code:

rec_length =  length(strip(record.a))
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Store the data for fixed length COBOL Programming 1
Search our Forums:

Back to Top