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
 

 

finding the length of records in the dataset in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: finding the length of records in the dataset in REXX
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

Moderator Team Head


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

PostPosted: Wed Jul 01, 2009 6:00 pm    Post subject: Reply to: finding the length of records in the dataset in RE
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 6:13 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 7:01 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Jul 01, 2009 7:14 pm    Post subject: Reply to: finding the length of records in the dataset in RE
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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