View previous topic :: View next topic
|
Author |
Message |
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
I tried to copy all the contents of file where the command was issued using the following code.
Code: |
/* REXX */
ADDRESS ISREDIT MACRO
"ISREDIT (DSNAME) = DATASET"
"ISREDIT (MEMNAME) = MEMBER"
DSN = DSNAME || "(" || MEMNAME || ")"
SAY DSN
"ALLOC FI(DDJCL) DA('"DSN"') OLD"
"EXECIO * DISKR DDJCL (STEM JCLLINES. FINIS "
|
For example when i issue command SAMP i want to copy all the contents of file DEV2.RK.JCL(NWAVRW08) to array.
Code: |
File Edit Edit_Settings Menu Utilities Compilers Test Help
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
VIEW DEV2.RK.JCL(NWAVRW08) - 01.00 Columns 00001 00072
Command ===> SAMP Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 //NWAVRW08 JOB (AOHW,4679),'THUR AGING RPT',CLASS=N,MSGCLASS=Q,
000002 // USER=OPSPROD
000003 //***************************************************************
000004 //* AVERSION THURSDAY AGING REPORT *
000005 //* FREQUENCY: THURSDAY NIGHT *
000006 //***************************************************************
000007 //JSTP0010 EXEC DCAVRW08,
000008 // SCHEMA='USSSUP01',
000009 // LOADLIB='APPLLIB',
000010 // IDMSLIB='IDMSLIB',
000011 // SYSIDMS='NWPDICT', |
But it displays error message that
Code: |
IKJ56246I DATA SET DEV2.RK.JCL NOT ALLOCATED, FILE IN USE
IRX0552E The input or output file DDJCL is associated with a partitioned data s
et. A member name must be specified.
IRX0670E EXECIO error while trying to GET or PUT a record.
***
|
Please let me know how to do that?
Thanks in advance
R KARTHIK |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't know how you can allocate a dataset that you currently have open and enqueued in an EDIT session with a disposition of OLD. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
this snippet will put in a stem variable all the lines of the thing being edited/viewed regardless of the organization
Code: |
ISREDIT (first) = LINENUM .zfirst
ISREDIT (last) = LINENUM .zlast
i = 0
do linenum = first to last
i = i + 1
ISREDIT (temp) = LINE linenum
line.i = temp
end
line.0 = i |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I think it would have worked with EXECIO, except that you probably had tried earlier versions of your rexx program. And you did not free DDJCL after previous attempts.
Based on the error messages, your most recent ALLOC did not work because you did not free it earlier. Or you can add REUSE to the ALLOC to use the same dd name.
Based on the error messages, the previous ALLOC did not specify a member name, so the subsequent EXECIO did not work.
And change OLD to SHR on your ALLOC statement. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Code: |
/* REXX */
Address isredit
'MACRO'
'(fin) = linenum .zl'
stem.0=fin
Do a=1 to stem.0; '(C) = line 'a ; stem.a=strip(c,'T') ; End
Do a=1 to stem.0; Say stem.a;End |
wasn't this question just asked a couple of days ago? |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
Thanks for all replies.
Pedro:
Quote: |
Or you can add REUSE to the ALLOC to use the same dd name.
|
It worked. And i tried enrico-sorichetti, MBabu code also.
Code: |
ADDRESS ISREDIT MACRO
"ISREDIT (FIRST) = LINENUM .ZFIRST"
"ISREDIT (LAST) = LINENUM .ZLAST"
I=0
DO LINENUM = FIRST TO LAST
I = I + 1
SAY LINENUM
"ISREDIT (TEMP) = LINE LINENUM"
LINE.I = TEMP
SAY LINE.I
END
LINE.0 = I
|
But it throws the following error
Code: |
Command in error . : (TEMP) = LINE LINENUM
Invalid line pointer
LPTR not numeric or label in syntax "ISREDIT (varname) = LINE LPTR".
|
Kindly clarify... |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
I solved the problem by replacing
"ISREDIT (TEMP) = LINE LINENUM"
to
"ISREDIT (TEMP) = LINE &LINENUM"
Regards
R KARTHIK |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Its just me. I do not care for using the ampersands. It looks too much like clists. I always use rexx notation and it will resolve the variable before passing the entire command to ISPF.
Code: |
"ISREDIT (TEMP) = LINE" LINENUM |
That is, LINENUM should be outside of the character string. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI Pedro,
Thanks for sharing the concept.....
Regards
R KARTHIK |
|
Back to top |
|
|
|