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 Read upto a particular Column

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


Joined: 24 May 2010
Posts: 6
Topics: 3

PostPosted: Thu May 27, 2010 1:52 am    Post subject: To Read upto a particular Column Reply with quote

Hi,

I have a dataset of length 133 and i need to read the contents only upto column 72 from it. Is there anyway to do it using Edit macros or REXX?
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu May 27, 2010 4:13 am    Post subject: Reply with quote

Yes.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Manick
Beginner


Joined: 24 May 2010
Posts: 6
Topics: 3

PostPosted: Thu May 27, 2010 5:17 am    Post subject: Reply with quote

Can you please let me know the macro or the REXX Command to get this done?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 27, 2010 6:47 am    Post subject: Reply with quote

read the record into a variable
use substr bif to replace the variable with the first 72 bytes

e.g
Code:

EXECIO 1 ddame(stem var) /* puts record into var1 */
var1 = substr(var1,1,72)

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu May 27, 2010 6:48 am    Post subject: Reply with quote

Please explain in a little more detail exactly what it is that you wish to accomplish, because with the information given in your original post it just begged for a YES/NO answer, which I happily gave.

Do you wish to retain the original dataset in its untouched state (recommended) or do you want to butcher that dataset - hopefully backed up beforehand.

What have you tried so far

My preferred method would be to read the original dataset into a stem, and then substring the records into a new output dataset, thus retaining the data integrity of the original input.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Manick
Beginner


Joined: 24 May 2010
Posts: 6
Topics: 3

PostPosted: Fri May 28, 2010 12:35 am    Post subject: Reply with quote

Hi Nic and expat,

Thanks for your replies. I used the SUBSTR command and it worked fine. I just need to read the records in to a STEM and then do some process on it. One of them is to remove the data after the 72nd column.

I did as Nic explained, by moving it to a variable and then use the SUBSTR command and it worked fine.
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