rexx macro is not executing



IBM's Command List programming language & Restructured Extended Executor

rexx macro is not executing

Postby venkateshm » Fri Jun 15, 2012 5:34 pm

Hi,
this is my first rexx macro...using rexx macro i want to use 'change all'. but my macro is not
executing.

rexx code : TEST.VENKY.PRAC(EDPDS)
/* REXX PROGRAM EDITPS */
LIB = "TEST.VENKY.PRAC"
ADDRESS 'ISPEXEC'
"LMINIT DATAID(INPUTDD) DATASET('"LIB"') ENQ(SHR)"
"LMOPEN DATAID("INPUTDD") OPTION(INPUT)"
MEMBER = 'CHGALL'
DO WHILE ( RC = 0 )
MEMBER = STRIP(MEMBER)
SAY "CALLING MACRO..."
"EDIT DATASET('"LIB"("MEMBER")') MACRO("MACRO")"
SAY "AFTER MACRO..."
END
"LMCLOSE DATAID("INPUTDD")"
"LMFREE DATAID("INPUTDD")"

macro:TEST.VENKY.PRAC(CHGALL)
/* REXX MACRO PROGRAM CHGALL */
SAY "CHGALL MACRO ENTERED"
"ISREDIT MACRO PROCESS"
"ISREDIT CHANGE '!UPPER-CASE' 'FUNCTION UPPER-CASE' ALL"
"ISREDIT END"
ADDRESS 'ISPEXEC'
RETURN

TEST.VENKY.PRAC(INPUT)
000001 !UPPER-CASE
000002 !UPPER-CASE
000003 !UPPER-CASE
000004 !UPPER-CASE
000005 !UPPER-CASE

error:
IKJ56500I COMMAND MACRO NOT FOUND
venkateshm
 
Posts: 10
Joined: Sun May 13, 2012 8:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: rexx macro is not executing

 

Re: rexx macro is not executing

Postby Akatsukami » Fri Jun 15, 2012 5:57 pm

Is TEST.VENKY.PRAC allocated to SYSPROC?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: rexx macro is not executing

Postby Pedro » Fri Jun 15, 2012 6:30 pm

"EDIT DATASET('"LIB"("MEMBER")') MACRO("MACRO")"

In your edit statement, MEMBER and MACRO are variables.

MEMBER is the name of the member you want to edit.
MACRO is the name of your editor macro.

I do not think you have set the variables MEMBER and MACRO to the actual names in your example.

And as Akatsukami mentioned, your macro needs to be in the SYSPROC concatenation.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: rexx macro is not executing

Postby Pedro » Fri Jun 15, 2012 6:39 pm

Your intention is not clear, but the use of LMOPEN implies that you should use the EDIT DATAID form rather than EDIT DATASET form.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: rexx macro is not executing

Postby venkateshm » Sat Jun 16, 2012 1:13 am

Thank you very much for quick replies....... using rexx macro i want to change my input data by change all command.

input file : TEST.VENKY.PRAC(INPUT)
000001 !UPPER-CASE
000002 !UPPER-CASE
000003 !UPPER-CASE
000004 !UPPER-CASE
000005 !UPPER-CASE

Desired output: TEST.VENKY.PRAC(INPUT)
000001 FUNCTION UPPER-CASE
000002 FUNCTION UPPER-CASE
000003 FUNCTION UPPER-CASE
000004 FUNCTION UPPER-CASE
000005 FUNCTION UPPER-CASE
Akatsukami :
I think my pds(TEST.VENKY.PRAC) is not allocated to SYSPROC, after doing some search i got few answers(TSO ISRDDN, etc..).
Let me check and let you know thank you very much......
venkateshm
 
Posts: 10
Joined: Sun May 13, 2012 8:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: rexx macro is not executing

Postby Pedro » Sat Jun 16, 2012 8:09 pm

In this statement:
"EDIT DATASET('"LIB"("MEMBER")') MACRO("MACRO")"

The variable 'MACRO' is not initialized, resulting in the value to be 'MACRO' as well (that is the way rexx works). When you run it, it will try to run an initial macro called MACRO.

Since you get this message:
IKJ56500I COMMAND MACRO NOT FOUND

I think your concatenation is correct.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: rexx macro is not executing

Postby venkateshm » Mon Jun 18, 2012 1:42 pm

TEST.VENKY.PRAC(ALC)
000001 /****************************** REXX *******************************/
000002 "ALLOC FI(SYSPROC) DA('FDMD482.TEST.MACRO') SHR REUSE"
000003 IF RC = 0 THEN
000004 SAY 'ALLOCATION TO SYSPROC COMPLETED.'
000005 ELSE
000006 SAY 'ALLOCATION TO SYSPROC FAILED.'

after executing this i got 'ALLOCATION TO SYSPROC COMPLETED.'

rexx code: TEST.VENKY.PRAC(EDPDS)
000100 /* REXX PROGRAM EDITPS */
000200 LIB = "TEST.VENKY.PRAC"
000300 ADDRESS 'ISPEXEC'
000400 "LMINIT DATAID(INPUTDD) DATASET('"LIB"') ENQ(SHR)"
000500 "LMOPEN DATAID("INPUTDD") OPTION(INPUT)"
000600 MEMBER = 'INPUT'
000700 DO WHILE ( RC = 0 )
000800 MEMBER = STRIP(MEMBER)
000801 SAY "CALLING MACRO..."
000810 "EDIT DATASET('"LIB"("MEMBER")') MACRO(CHGALL)"
001110 SAY "AFTER MACRO..."
001200 END
001300 "LMCLOSE DATAID("INPUTDD")"
001400 "LMFREE DATAID("INPUTDD")"
when iam trying to execute my rexx code, iam getting a message

CALLING MACRO...
IKJ56500I COMMAND NOPACK NOT FOUND

and whenever i go for edit any file the following mesage is displayed.

EDIT TEST.VENKY.PRAC(INPUT) - 01.02 Macro does not exist
Command ===> NOPACK Scroll ===> CSR


macro: FDMD482.TEST.MACRO(CHGALL)
000100 /* REXX MACRO PROGRAM CHGALL */
000200 SAY "CHGALL MACRO ENTERED"
000300 ADDRESS ISREDIT
000310 "MACRO PROCESS"
000320 "CHANGE ALL 'ABC' 'CHANGED'"
000330 "SAVE"
000340 "END"
000350 EXIT

need help on this...
venkateshm
 
Posts: 10
Joined: Sun May 13, 2012 8:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: rexx macro is not executing

Postby prino » Mon Jun 18, 2012 1:52 pm

venkateshm wrote:TEST.VENKY.PRAC(ALC)
000001 /****************************** REXX *******************************/
000002 "ALLOC FI(SYSPROC) DA('FDMD482.TEST.MACRO') SHR REUSE"
000003 IF RC = 0 THEN
000004 SAY 'ALLOCATION TO SYSPROC COMPLETED.'
000005 ELSE
000006 SAY 'ALLOCATION TO SYSPROC FAILED.'

after executing this i got 'ALLOCATION TO SYSPROC COMPLETED.'

And in the process you removed all standard site-specific libraries from SYSPROC, which is a very smart thing to do as you must realize now!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: rexx macro is not executing

Postby venkateshm » Mon Jun 18, 2012 3:00 pm

Thank you prino...
i got the mistake.....
to concat is this one right..
000001 /****************************** REXX *******************************/
000002 ADDRESS TSO "ALLOC DATASET('FDMD482.TEST.MACRO') DD(MYPROC) SHR REU"
000003 ADDRESS TSO "CONCAT (SYSPROC MYPROC)"
000004 IF RC = 0 THEN
000005 SAY 'ALLOCATION TO SYSPROC COMPLETED.'
000006 ELSE
000007 SAY 'ALLOCATION TO SYSPROC FAILED.'
venkateshm
 
Posts: 10
Joined: Sun May 13, 2012 8:57 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post