View previous topic :: View next topic
|
Author |
Message |
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
Hi all,
I want to open a PS dataset which contains the PDS member name
Use the member and open the member in the another PDS dataset
find all pic9(10) and change it to 9(12)
and route the result to another datatset.
How Could I code it in Rexx.Anyone please help me out.
ADDRESS TSO
ADDRESS ISREDIT
"MACRO"
"NUM ON STD COB"
"UNNUM"
"RESET"
"ALLOC FI(INFIL) DA('SAMPLE.DSET') SHR REU'
'EXECIO * DISKR INFIL (STEM INREC. FINIS'
if RC = 0 then
DO I = 1 TO INREC.0
PGM = STRIP(INREC.I)
SAY ''PGM''
CALL RQSTDSET
IF RC /= 0 then
say 'ERROR:SOURCE PROGRAM "INREC.I" NOT FOUND '
EXIT
END
else
say 'THE FILE HAS NOT BEEN READ'
EXIT
"FREE F(INFIL)"
when i gave this its going to Else part ''THE FILE HAS NOT BEEN READ' .Please help me out in this too.Its also saying bad arthmetic conversion in DO I = 1 TO INREC.0 . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Have you tried running with a TRACE ? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
I fully agree with expat !
Also have a look at your piece of code. You have one IF, then DO and another IF statement. But i could see only END statement once.
Regards, UmeySan |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I would probably use something like
Code: |
"ALLOC FI(INFIL) DA('SAMPLE.DSET') SHR REU'
'EXECIO * DISKR INFIL (STEM INREC. FINIS'
If RC = 0 then
DO I = 1 TO INREC.0
PGM = STRIP(INREC.I)
"Ispexec edit
dataset('dataset name(PGM)')
MACRO(macro)"
If RC <> 0
Then say something
END
"FREE F(INFIL)"
EXIT
|
|
|
Back to top |
|
|
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
Thanks Expat.
Now I have another doubt such that I have pointed my cursor in a partcular line
Say line 20
Now I have read the line 20 into a Variable
I want to delete the line or insert two blank lines above the line 20
For Eg: The input is
Line 18 ABC
line 19 DEF
Line 20 Content
Output should be:
Line 16 ABC
Line 17 DEF
Line 18 **** COMMENT
LINE 19*
Line 20 *COntent
line 21 CONTENt
line 22 *
line 23****Comment
How Could i achieve that |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
INSERT BEFORE
INSERT AFTER
Take a look at the ISPF edit macro book, or search the forum, as I have posted some examples in the last few weeks. |
|
Back to top |
|
|
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
Thanks Expat.
Now I have a new doubt
I have a function
In that function I am calling macro
RQSTDSET:
DSNNAME = APPOFSDC.DEV.KAR.PDS.NEW
DSET.I = DSNNAME || '(' || PGM ||')'
DSET.I = "'" || DSET.I || "'"
ADDRESS ISPEXEC
"EDIT DATASET("DSET.I") MACRO(FIRE1)"
"EXECIO" outrec "DISKW TEMP ( STEM pgmlines. FINIS"
"FREE F(OUTFIL)"
After that I am writing the result from the macro into the output file.But its saying EXECIO not supported
Should i pass the variables pgmlines and outrec to the macro.If So HOW? |
|
Back to top |
|
|
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
i am getting an error of
ISPF Dialog Error
Command ===>
More: +
******************************************************************************
* ISPS102 *
* *
* Invalid service name *
* 'ALLOC' is not a recognized dialog service name. *
* *
* *
* *
* *
* *
* *
* Current dialog statement: *
* ALLOC FI(OUTFIL) DA('APPOFSDC.DEV.OUTPUT.DATASET') MOD REUSE *
* *
* Enter HELP command for further information regarding this error. *
* Press ENTER key to terminate the dialog. *
* *
* / Override termination and attempt to continue? (/ = Yes) *
* * |
|
Back to top |
|
|
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
Hello Expat.
I have a subroutine
I am calling a macro from the subroutine
The MAcro reads a line from the application program and changes the format of the line
Now I need to route the changes(ie the changed line) to the output dataset.The dataset is opened in the Subroutine.
How could i achieve this.Please help ASAP.
GImme me some tips and sample code |
|
Back to top |
|
|
thirumalaisamy Currently Banned New User
Joined: 24 Mar 2008 Posts: 7 Location: india
|
|
|
|
Please someone help me out in this |
|
Back to top |
|
|
|