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
 
change of variable in Procedure division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
sangeetha_vama

New User


Joined: 13 Dec 2006
Posts: 3
Location: Chennai

PostPosted: Wed Aug 01, 2007 10:13 am    Post subject: change of variable in Procedure division
Reply with quote

Hi Friends, I am facing a problem in my REXX program.I have to change a variable name with a new variable name wherever it is found in my program.

FOR ex-my requirement is to change a variable:ws-emp-no(old variable) to ws-emp-number(new variable).It has to change in the working storage section,and as well as in procedure division also.i.e if a stmt like-
IF ws-emp-no is greater than 1000 ........ has to be changed to
IF ws-emp-number is greater than 1000 ..so on conditions where ever it is found
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Aug 01, 2007 11:49 am    Post subject:
Reply with quote

Why can't you use the CHANGE command?

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

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Wed Aug 01, 2007 11:57 am    Post subject:
Reply with quote

Hi Sangeetha,

Can you show the code in which your are getting error.Do you want to make the changes in the same file itself or do you want to write the changed one in the new file

Thanks
Sai
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 Aug 01, 2007 2:23 pm    Post subject:
Reply with quote

If you are changing multiple members then you will need to get the member names of the PDS and then use an ISPF edit macro on each member.

These have been discussed before in the forums.
Back to top
View user's profile Send private message
sangeetha_vama

New User


Joined: 13 Dec 2006
Posts: 3
Location: Chennai

PostPosted: Wed Aug 01, 2007 3:03 pm    Post subject:
Reply with quote

i want the changed one to a new file
Back to top
View user's profile Send private message
sangeetha_vama

New User


Joined: 13 Dec 2006
Posts: 3
Location: Chennai

PostPosted: Wed Aug 01, 2007 3:17 pm    Post subject:
Reply with quote

here is my code

/*REXX*/
TRACE O
SAY 'ENTER THE VARIABLE TO BE CHANGED'
/* PARSE UPPER PULL VAR1 */
PULL VAR1
DSNIN = 'NBDT2GU.TEST.SCRLIB(TESTFPG)'
DSNOU = 'NBDT2GU.TEST.REXX(NEW1)'
INSER = ' WS-EMP-NO1'
'ALLOC FI($FIL1) DA('DSNIN') SHR REUSE'
ADDRESS MVS 'EXECIO * DISKR $FIL1 (STEM PRO. FINIS'
'FREE FI($FIL1)'
DO I = 1 TO PRO.0
SEARCH = FIND(PRO.I,VAR1)
IF SEARCH = 0
THEN
QUEUE PRO.I
ELSE
DO
QUEUE PRO.I
QUEUE INSER
END
END
'ALLOC FI($FIL2) DA('DSNOU') SHR REUSE'
ADDRESS MVS 'EXECIO * DISKW $FIL2 ( FINIS'
'FREE FI($FIL2)'
DELSTACK
EXIT
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Wed Aug 01, 2007 4:24 pm    Post subject:
Reply with quote

Hi Sangeetha,

Use the below code in your Do loop
Code:
DO I = 1 TO PRO.0
     IF INDEX(PRO.I,VAR1,1) > 0 THEN   
         DO                                         
            POSN = POS(VAR1,PRO.I)           
            POSN = POSN - 1                           
            TEST = INSERT(INSER,PRO.I,POSN)
            POS2 = POS(VAR1,TEST)                 
           OUT.I = DELSTR(TEST,POS2,8)           
         END                                         
   ELSE                                         
      OUT.I = PRO.I
END   
"EXECIO * DISKW $FIL2 (STEM OUT. FINIS"   


Thanks
Sai
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 Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts change string before sertan string anatol DFSORT/ICETOOL 8 Tue Aug 15, 2017 5:43 pm

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