View previous topic :: View next topic
|
Author |
Message |
jtwohig
New User
Joined: 24 Jul 2006 Posts: 18
|
|
|
|
Hi,
I've looked in the Ez manuals but can't seem to find an example of how to read a whole VSAM file sequentially. All I want to do is read the whole VSAM file, extract two fields and write them to a flat file.
Thanks,
J. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Declare the filename as VS in the file specification.
Use the same "JOB INPUT filename" syntax that you would use for a QSAM file.
Unless you terminate the code, it will read the whole file. . . |
|
Back to top |
|
|
jtwohig
New User
Joined: 24 Jul 2006 Posts: 18
|
|
|
|
Thanks Dick !
How would I code the "READ" statement ?
I know if I'm doing a random lookup I code this:
READ VSAMFILE KEY VS-KEY
but how would I code to READ the whole file ?
Thanks!
J. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello J,
You should be able to
Quote: |
Use the same "JOB INPUT filename" |
As you are reading sequentially, you don't need the READ/KEY specification.
Sorry this didn't get sent earlier - thought i'd sent it, but was interrupted and had not. |
|
Back to top |
|
|
jtwohig
New User
Joined: 24 Jul 2006 Posts: 18
|
|
|
|
Ok, here's what I have, but I keep getting errors:
JOB INPUT(VSAMFILE)
READ VSAMFILE
*******B054 NOT A VALID FILE - VSAMFILE
*******B026 REQUIRED PARAMETER IS NOT CODED - KEY
I define the file as:
1 FILE VSAMFILE VS
2 W-FIELD1 1 7 A
3 W-FIELD2 8 2 N
I'm not sure what I'm doing wrong...
Thanks,
J. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Try replacing this
Code: |
JOB INPUT(VSAMFILE)
READ VSAMFILE
|
with
|
|
Back to top |
|
|
|