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
 
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: 4650
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: 6970
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: 8620
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: 6970
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: 8620
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: 2088
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

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