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
 
Processing Multiple members

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
GaneshKarunyarajan

New User


Joined: 12 Apr 2005
Posts: 13

PostPosted: Tue Sep 22, 2009 4:08 am    Post subject: Processing Multiple members
Reply with quote

Hi,

I'm trying to read multiple members in the dataset and change values in it. I used LM, but the last few lines from first file is getting appended in the second file. I think the buffer is not getting reset. But not sure how to clear the buffer and then read the next file.

Any help on this will be really greatfull.

Regards,
Ganesh.K
Back to top
View user's profile Send private message

Pedro

Senior Member


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

PostPosted: Tue Sep 22, 2009 4:27 am    Post subject: Reply to: Processing Multiple members
Reply with quote

Show us the code. Especially the 'buffer' part. Please elaborate on 'LM'.
Back to top
View user's profile Send private message
GaneshKarunyarajan

New User


Joined: 12 Apr 2005
Posts: 13

PostPosted: Tue Sep 22, 2009 8:56 am    Post subject:
Reply with quote

Code:

ADDRESS 'ISPEXEC'                                                     
"LMINIT DATAID(INPUTDD) DATASET('"DATASET"') ENQ(SHRW)"               
"LMOPEN DATAID("INPUTDD") OPTION(INPUT)"                             
MBR = ' '                                                             
SAVERC = 0                                                           
DO WHILE (SAVERC = 0) & (ENDNOW \= 'Y')                               
   "LMMLIST DATAID("INPUTDD") MEMBER(MBR) OPTION(LIST) STATS (NO)"   
   SAVERC = RC                                                       
"ISREDIT MACRO PROCESS"                                           
ADDRESS ISREDIT "MACRO "                                           
ADDRESS ISREDIT "(DS) = DATASET"                                   
ADDRESS ISREDIT "(MEM) = MBR"                                     
  PDS_DSNAME = "'" || DATASET || "(" || MBR || ")'"               
  SRCFILE = PDS_DSNAME                                             
                                                                   
SAY "DATASET:" SRCFILE                                             
  ADDRESS TSO "ALLOCATE DDNAME(SOURCE) DSN(" || SRCFILE || ") SHR"
  ADDRESS TSO "EXECIO * DISKR SOURCE (STEM COUNT. FINIS"           
DO J = 1 TO COUNT.0       
                         
  LINE = COUNT.J         

SELECT                                             
     WHEN THEN DO                   
          OUT.COUNTER = Line 
          COUNTER = COUNTER + 1                   
     END                                           
     OTHERWISE DO         
          OUT.COUNTER = Line     
          COUNTER = COUNTER + 1                   
          SAY 'JOB2' DBCHG DBCHG1                 
     END                             

 ADDRESS TSO "EXECIO * DISKW SOURCE (STEM OUT. FINIS"     
 ADDRESS TSO "FREE F(SOURCE)"                             
 ADDRESS ISREDIT "END"                                   
 END 
"LMCLOSE DATAID("INPUTDD")"           
"LMFREE DATAID("INPUTDD")"
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: Tue Sep 22, 2009 11:30 am    Post subject:
Reply with quote

Quote:
Your code is not what you use, there is no way in the world that the above junk will work.

Must admit, I'm a bit confused as to what the OP hopes to achieve, because I can't find out from the code.

Maybe if the OP could tell us exactly what it is that needs to be achieved then we can at least suggest something practicle and readable.

If my first thoughts are correct and changes are required, surely an edit macro would be a zillion times faster than reading every member that needs change.

And ............................ Use the code tags !!!
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Tue Sep 22, 2009 4:58 pm    Post subject:
Reply with quote

@ GaneshKarunyarajan !

You can loop-up the memberlist of the PDS and edit every member with an edit-macro, where your changes are defined.


REXX-Proc:

"ISREDIT MACRO (editmac)"
"ISREDIT (openpds) = DATAID"
"ISREDIT (openmbr) = MEMBER"

address ispexec
"LMOPEN DATAID("openpds") OPTION(INPUT)"
mbr = ' '
listrc = 0

do while listrc = 0
"LMMLIST DATAID("openpds") MEMBER(mbr) OPTION(LIST) STATS(NO)"
listrc = rc
if listrc = 0 & mbr <> openmbr then do
"EDIT DATAID("openpds") MEMBER("mbr") MACRO("editmac")"
end
end

"LMMLIST DATAID("openpds") OPTION(FREE)"
"LMCLOSE DATAID("openpds")"

exit


Edit-Macro:

ISREDIT MACRO
ISREDIT C 'IE202' 'J150630' ALL
ISREDIT SAVE
ISREDIT END
Back to top
View user's profile Send private message
GaneshKarunyarajan

New User


Joined: 12 Apr 2005
Posts: 13

PostPosted: Tue Sep 22, 2009 7:04 pm    Post subject:
Reply with quote

Thanks a lot for your reply...

Do I have to define the Edit Macro in a seperate file or in the same one
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Sep 22, 2009 7:21 pm    Post subject:
Reply with quote

Separate member.

O.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Sep 22, 2009 7:31 pm    Post subject: Reply to: Processing Multiple members
Reply with quote

Use a separate member in the same PDS.

Quote:
I'm trying to read multiple members in the dataset and change values in it.

You describe the problem as two parts (separated by AND). My suggestion is, in these kinds of complicated situations, to break up your program into two parts, as UmeySan has shown.
Back to top
View user's profile Send private message
GaneshKarunyarajan

New User


Joined: 12 Apr 2005
Posts: 13

PostPosted: Tue Sep 22, 2009 8:43 pm    Post subject:
Reply with quote

As you all suggested, I defined a seperate Macro and tried to read all the lines of the member and look for my check and changing it.
Now on the Edit Mac I have my coding. It is not able to recognizethe dataset. I think we have to pass the dataset value in the
"EDIT DATAID("openpds") MEMBER("mbr") MACRO("editmac")"
but I'm not sure how to pass

Editmac:
=======
"ISREDIT MACRO PROCESS"
ADDRESS ISREDIT "MACRO "
ADDRESS ISREDIT "(DS) = DATASET"
ADDRESS ISREDIT "(MEM) = MBR"
PDS_DSNAME = "'" || DATASET || "(" || MBR || ")'"
SRCFILE = PDS_DSNAME

SAY "DATASET:" SRCFILE
ADDRESS TSO "ALLOCATE DDNAME(SOURCE) DSN(" || SRCFILE || ") SHR"
ADDRESS TSO "EXECIO * DISKR SOURCE (STEM COUNT. FINIS"
DO J = 1 TO COUNT.0

LINE = COUNT.J

SELECT
WHEN ws-1 = "XXX" THEN DO
OUT.COUNTER = Line
COUNTER = COUNTER + 1
END
WHEN ws-2 = "XXX" THEN DO
OUT.COUNTER = Line
COUNTER = COUNTER + 1
END
WHEN ws-3 = "XXX" THEN DO
OUT.COUNTER = Line
COUNTER = COUNTER + 1
END
OTHERWISE DO
OUT.COUNTER = Line
COUNTER = COUNTER + 1
SAY 'JOB2' DBCHG DBCHG1
END

ADDRESS TSO "EXECIO * DISKW SOURCE (STEM OUT. FINIS"
ADDRESS TSO "FREE F(SOURCE)"
ADDRESS ISREDIT "END"
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Sep 22, 2009 9:22 pm    Post subject: Reply to: Processing Multiple members
Reply with quote

Your original program mixed editor macro functions with execio functions, we all thought you wanted to used editor functions.

When you are using the editor macro, you do not need to use EXECIO to read the file. If I understand what you are trying to do, I suggest writing your editor macro to use FIND and FIND_COUNTS services. See the Editor manual for more information.

--OR-- you could do it with EXECIO instead of an editor macro. But you should not use EXECIO within the editor macro.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Historical/statistical details for me... elixir1986 TSO/ISPF 13 Wed Aug 30, 2017 9:02 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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