IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cut Lines of Code from a member of a PDS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lakshmi.R

New User


Joined: 12 Sep 2005
Posts: 10
Location: bangalore

PostPosted: Fri Feb 17, 2006 6:38 pm
Reply with 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.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Fri Feb 17, 2006 7:07 pm
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Fri Feb 17, 2006 7:21 pm
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Fri Feb 17, 2006 7:41 pm
Reply with quote

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
View user's profile Send private message
Lakshmi.R

New User


Joined: 12 Sep 2005
Posts: 10
Location: bangalore

PostPosted: Wed Mar 01, 2006 7:11 pm
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Mar 02, 2006 9:53 am
Reply with quote

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
View user's profile Send private message
Lakshmi.R

New User


Joined: 12 Sep 2005
Posts: 10
Location: bangalore

PostPosted: Fri Mar 03, 2006 3:06 pm
Reply with quote

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
View user's profile Send private message
Lakshmi.R

New User


Joined: 12 Sep 2005
Posts: 10
Location: bangalore

PostPosted: Fri Mar 03, 2006 4:30 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Mark Previous & next lines when a... DFSORT/ICETOOL 9
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top