View previous topic :: View next topic
|
Author |
Message |
chaoj
Active User
Joined: 03 Jun 2010 Posts: 103 Location: Dalian
|
|
|
|
I used to use LMGET and LMPUT to read and write a data set
these days I found EXECIO , which is the best way to read and write a data set? what's the difference between EXECIO and LMGET/PUT?
Is the efficiency different or other ? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I do not know which is more efficient, but LMGET/LMPUT have much higher overhead. ISPF is a requirement.
I have not followed any benchmarks... you should try writing a file of about 10,000 lines using both methods and compare the results (elapsed time / service units). |
|
Back to top |
|
|
chaoj
Active User
Joined: 03 Jun 2010 Posts: 103 Location: Dalian
|
|
|
|
Pedro wrote: |
I do not know which is more efficient, but LMGET/LMPUT have much higher overhead. ISPF is a requirement.
I have not followed any benchmarks... you should try writing a file of about 10,000 lines using both methods and compare the results (elapsed time / service units). |
yes , you're right , LMGET/LMPUT need the ISPF ,
and the EXECIO runs in both the TSO/E address space and non-TSO/E address spaces |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Just for fun I setup a test for this.
In a single program I read the same file both ways.
The file contained 47298 records.
For the lmget, it was in a loop until rc > 0.
For the execio, I read the file into a stem variable and accessed each occurance in a loop after the execio statement.
No other processing on the data was performed.
The results are:
Code: |
READY
PROFILE NOPREFIX
READY
ISPSTART CMD(%BENCHIO LMGET EXECIO)
IN BENCHIO - LMGET EXECIO
LMGET ELAPSED TIME - 8.564209 47298
EXECIO ELAPSED TIME - 0.341466 47298 |
A side note, I also ran the execio process without starting ISPF.
There was no noticable change in time. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Dave,
was this test run in background?
did you use dd statements to allocate the file(s)? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Yes it was run in the background.
For the execio process, the file was allocated in the jcl.
For the lmget, I used lminit, lmopen, lmget(in loop).
I did run this again in the forground, adding an alloc before the execio.
Results:
Code: |
IN BENCHIO - LMGET EXECIO
LMGET ELAPSED TIME - 8.367988 47298
EXECIO ELAPSED TIME - 0.285204 47298
|
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Another useless piece of information.
In my Production REXX code:
Execio is used 1300+ times
Lmget is used 2 times (I do not remember why I chose to do it that way) |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
EXECIO is a REXX function.
LM..... is an ISPF SERVICE.
can use LM... in REXX, COBOL, CLIST, PL1
can only use EXECIO in REXX
i personally- use EXECIO for small files and single pds member processing
- for large records/large files I use LM... in REXX, and for multiple PDS member processing in REXX,COBOL
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
can use LM... in REXX, COBOL, CLIST, PL1 |
Good point. I suspect the performance of LM services will be much better in compiled languages than when called in rexx. |
|
Back to top |
|
|
chaoj
Active User
Joined: 03 Jun 2010 Posts: 103 Location: Dalian
|
|
|
|
dbzTHEdinosauer wrote: |
EXECIO is a REXX function.
LM..... is an ISPF SERVICE.
can use LM... in REXX, COBOL, CLIST, PL1
can only use EXECIO in REXX
i personally- use EXECIO for small files and single pds member processing
- for large records/large files I use LM... in REXX, and for multiple PDS member processing in REXX,COBOL
|
oh, yes ! EXECIO can not process multi-member PDS.
I like your answer and this forum ! |
|
Back to top |
|
|
chaoj
Active User
Joined: 03 Jun 2010 Posts: 103 Location: Dalian
|
|
|
|
daveporcelan wrote: |
Yes it was run in the background.
For the execio process, the file was allocated in the jcl.
For the lmget, I used lminit, lmopen, lmget(in loop).
I did run this again in the forground, adding an alloc before the execio.
Results:
Code: |
IN BENCHIO - LMGET EXECIO
LMGET ELAPSED TIME - 8.367988 47298
EXECIO ELAPSED TIME - 0.285204 47298
|
|
Thanks for your testing , it seems that if I don't compile , EXECIO is more fast than LM... |
|
Back to top |
|
|
|