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

ISPF macro: problem in defining line variable


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Mar 12, 2009 5:50 pm
Reply with quote

hi ,
i have written a ispf macro. that macro is for copying specific set of lines from a dataset and to store those lines in some variables. so that i can write these variables to another result dataset.

the problem here is, for the following loop,
COUNT=1
DO RLINE = FIRST TO LAST BY 1
"ISREDIT (JP."COUNT") = LINE "RLINE
COUNT=COUNT+1
END
FIRST and LAST are the line numbers.....
i could not define the variable is jp.count because it is saying... the syntax is wrong ...... how can i define a variable to get all the lines of that dataset into the variables.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Mar 12, 2009 5:52 pm
Reply with quote

i have also tried like without '.' ........ like jp"count" ...... but i couldnt get the values back .... since i cannot form a loop for getting the values of
jp1
jp2
jp3
jp4

since if i give jpcount ...... it will be considered as a single variable.....
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Mar 12, 2009 6:46 pm
Reply with quote

Do it the easy way:
Code:
COUNT=1
DO RLINE = FIRST TO LAST BY 1
   "ISREDIT (LI) = LINE "RLINE
   JP.COUNT = LI
   COUNT=COUNT+1
END
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Mar 12, 2009 9:27 pm
Reply with quote

I prefer starting with zero, otherwise the count is one too many.

Code:
COUNT=0
DO RLINE = FIRST TO LAST BY 1
   "ISREDIT (LI) = LINE "RLINE
   COUNT=COUNT+1
   JP.COUNT = LI
END
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Mar 12, 2009 9:29 pm
Reply with quote

You might also try using the CUT macro statement followed later by a macro that uses PASTE.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Fri Mar 13, 2009 10:25 am
Reply with quote

thanks marso and pedro...... i got it ..... that was very simple .... how come i didnt get that idea ....... icon_redface.gif
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top