| View previous topic :: View next topic |
| Author |
Message |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sat Feb 22, 2003 3:21 am Post subject: ISREDIT COPY Command - Getting the No. Of Lines Copied. |
|
|
I'm using the following command in my Rexx routine to copy a set of copybooks into the program.
| Code: |
"ISREDIT COPY "DSN_NAME" AFTER .ZCSR"
|
Is there any way to know how many lines have been copied. Anyway, I want to copy the entire copybook (.ZFIRST - .ZLAST). But I'm using a Panel in which I have the details like which copybook has been found, and where it is found and how many lines it contains.... Previously, I was capturing the file info. into a Stem and copy the contents using a loop. But I felt that as in-efficient.
So, I would like to know whether there is any way to know the no. of lines in the copybook without opening it using Alloc (or) other commands and reading it (or) opening it via a Macro and then find for .ZLAST and fetch the line number of .ZLAST.
Will ISPF store the no.of lines copied into some system variable.
Please Advise.
Thanks,
Phantom, |
|
| Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sat Feb 22, 2003 1:00 pm Post subject: |
|
|
| No, but what is wrong with looking at .zlast before and after your copy? It's only 3 lines of code including the subtraction. |
|
| Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sun Feb 23, 2003 10:40 pm Post subject: |
|
|
| No Semigeezer, I don't mind coding the 3 additional lines to find out the no. of lines. But finding out the value of .ZLAST means that, open the PS using another MACRO and then find the .ZLAST. ie. It includes additional I/O Operation which I think would be in-efficient, just to find out the no. of lines. So, I just want to know whether, the COPY command stores the value in some system variable which could be read without additional I/O. B'cas opening the same PS once for copying the contents and again for finding out the no. of lines is totally in-efficient. |
|
| Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sun Feb 23, 2003 10:45 pm Post subject: |
|
|
| ??? I don't understand why you would need to open it twice. You get the size of the data set before the copy, do the copy, get the new size and subtract. |
|
| Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sun Feb 23, 2003 10:55 pm Post subject: |
|
|
Sorry,
I don't understand what you are saying. To get the size of the file that file must be opened via a MACRO, correct. Just like this
| Code: |
"ISPEXEC EDIT DATASET(dsn) MACRO(macro)"
|
Then use the .ZLAST command to find out the line. Then how would you copy the contents in the main program, b'cas now the MACRO is pointing to the copybook and not to the main program. So, you need to come back to the main routine and again give "ISREDIT COPY ... AFTER .ZCSR".
If I am wrong please explain me, where I went wrong.
Thanks,
Phantom, |
|
| Back to top |
|
 |
Premkumar Moderator

Joined: 28 Nov 2002 Posts: 77 Topics: 7 Location: Chennai, India
|
Posted: Sun Feb 23, 2003 11:00 pm Post subject: |
|
|
Semigeezer says,
1. Get the size of the program before you copy the copybook into it.
2. Get the size of the program after you copy the copybook into it.
3. Difference will give you the size of the copybook you copied. |
|
| Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sun Feb 23, 2003 11:02 pm Post subject: |
|
|
| Okay, I got it now, Thanks Premkumar & Semigeezer. |
|
| Back to top |
|
 |
|
|
|