View previous topic :: View next topic
|
Author |
Message |
Lakshmi.R
New User
Joined: 12 Sep 2005 Posts: 10 Location: bangalore
|
|
|
|
How do i cut lines of code from a member that is inside a PDS using copy
I don't want to copy members. |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi,
Quote: |
How do i cut lines of code from a member that is inside a PDS using copy I don't want to copy members. |
Do u want to pnly CUT or CUT+PASTE?
Regards
Rupesh |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
This you can solve by 2 ways :-
1. By macro, write a macro which will just move the curosor to the start of your deleting portion and use a label to mark it and then move the cursor to the end of your deleting portion and give a label to it. Now use the following command -
"DEL ALL <Starting Label> <Ending Label>"
2. Using EXECIO DISKR. However by DISKR, you are putting the contents of the DS in to a stem. Now from the starting line no to ending line no u just make the stem's content as null. Now open the DS again and write it by EXECIO DISKW keeping a condition that it should not write any null content of the stem.
According to me, using macro will help you a lot. You better go for it.
Look Laskhmi I have taken the consideration that you know the line no you want to delete. If you dnt know the line no, then modify the logic according to your requirement. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
For setting up the label in the macro, I am sending you the sample code -
/* REXX */
address ispexec "control errors return"
address ispexec
address isredit
"macro"
cr = 1
cc = 1
"cursor = (cr cc)"
"(line) = line .zcsr"
"label 1 = .a 0" //sets the 1st line as label .a
cr = 10
"cursor = (cr cc)"
"(line) = line .zcsr"
"label 10 = .b 0" //sets the 10th line as label .a
"del all .a .b"
"save"
"end"
return |
|
Back to top |
|
|
Lakshmi.R
New User
Joined: 12 Sep 2005 Posts: 10 Location: bangalore
|
|
|
|
I tried the following macro and when i execute giving TSO CURSOR on the command line
only the 4 th line is printed ...i am not getting the value of CURSL & CURSC.
Let me know what needs to be done.
Thanks
Lakshmi
VIEW A.CLIST(CURSOR) - 01.02
Command ===>
****** ***************************** Top of Data **********
000001 /*REXX*/
000002 ADDRESS ISREDIT "MACRO PROCESS"
000003 ADDRESS ISREDIT "(CURSL,CURSC) = CURSOR"
000004 SAY "CURSOR IS AT LINE" CURSL "COLUMN" CURSC
****** **************************** Bottom of Data ******** |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hey what for u r using the command "tso <your_rexx_macro_name>". You first concat the library with SYSPROC/SYSEXEC and then open any DS , in the command line just type <your_macro_name> , place the cursor in a specific line and press <Enter>. Now ur macro will work.
Code: |
/* REXX */
address isredit
"macro"
"(CURSL,CURSC) = CURSOR"
SAY "CURSOR IS AT LINE" CURSL "COLUMN" CURSC
"(line) = line .zcsr"
say "line : " line
"end"
|
[/i] |
|
Back to top |
|
|
Lakshmi.R
New User
Joined: 12 Sep 2005 Posts: 10 Location: bangalore
|
|
|
|
Amit,
I am still not able to do run my macro.
This is what i did
/* REXX */
ADDRESS ISREDIT
"MACRO"
TRACE I
"CURSOR = 1 5"
"(MYLINE) = LINE,.ZCSR"
SAY MYLINE
Member i tried the macro with
EDIT LST.LAKSH.TEST1(A) -
Command ===>
****** ***************************** Top of Da
000100 this is a test file
000200 this is a test file
000300 this is a test file
000400 this is a test file
000500 this is a test file
My trace output
5 *-* "CURSOR = 1 5"
>L> "CURSOR = 1 5"
+++ RC(20) +++
6 *-* "(MYLINE) = LINE,.ZCSR"
>L> "(MYLINE) = LINE,.ZCSR"
+++ RC(20) +++
7 *-* SAY MYLINE
>L> "MYLINE"
MYLINE
***
Let me know what is the mistake that i am doing... |
|
Back to top |
|
|
Lakshmi.R
New User
Joined: 12 Sep 2005 Posts: 10 Location: bangalore
|
|
|
|
Amit,
Now finally the macro worked...
Thanks for the idea about the macro...i knew about this only after u had given it as a suggestion...
Now the macro that i executed finally is this
/*REXX */
'ISREDIT MACRO'
ECNT = 0
ADDRESS ISREDIT "(LINES) = LINENUM .ZLAST"
DO I = 1 TO LINES
ADDRESS ISPEXEC "ISREDIT (LINE) = LINE" I ""
ECNT = ECNT + 1;ETXT.ECNT = LINE
SAY ETXT.ECNT
END
END
RETURN 0
Lakshmi |
|
Back to top |
|
|
|