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
 

 

Cut Lines of Code from a member of a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Cut Lines of Code from a member of a PDS
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: 464

PostPosted: Fri Feb 17, 2006 7:07 pm    Post subject: Re: Cut Lines of Code from a member of a PDS
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    Post subject:
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    Post subject: Re: Cut Lines of Code from a member of a PDS
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    Post subject: Re: Cut Lines of Code from a member of a PDS
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    Post subject:
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    Post subject: Re: Cut Lines of Code from a member of a PDS
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    Post subject: Re: Cut Lines of Code from a member of a PDS ---worked
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    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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am


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