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: 6967
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: 6967
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: 2038
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm


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