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
 

 

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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


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