Page 1 of 1

Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 4:37 am
by ash4u
Hi..

Can anyone help me to know if we can upload images to a VSAM (KSDS) file. As of now we use PDS members to load the images and use it for statement documents. Now i need to load these to a VSAM as there can be so many images and I just cant have that much members for my PDS.
Basically I am looking for is, can I have all my image members copied to a VSAM file, where key will be used to identify the image name. Key will have the image name and data will have the binary image uploaded for this KSDS.

Thanks in advace for your help!!

Re: Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 5:23 am
by Robert Sample
How many images are you dealing with? We have PDS files at our shop with 4,000 members in them.

As far as I know, there's no problem with doing what you want as long as the images are small enough to fit into one record. And if they're fitting into a PDS, they should fit into a VSAM KSDS.

Re: Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 9:21 am
by ash4u
Basically these are going to be cheque images for a customer....so there can be any no of customers and each one customer may have any no of cheques for a cycle......thats why Im bothered to use PDS members for these images. We are going to ask other team to get that available somewhere on mainframe from where I can pick up to display it on statements... and also there can be sceanario where 2 customers can have same cheque numbers and I just cant have image names (member) unique due to limitaion of 8 bytes length for a member name.............please suggest where and how I can store these images without any limitation and easy to retrieve..?
Also if I have suppose 10 PDS member images, can I have it copied to a VSAM, where I can use some key to link each image...e.g. key will be account number and the data part will have the respective image..so VSAM will have 10 entries with acct number as a key and the respective image for each acct number as data part......

Thanks for all ur help!

Re: Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 10:10 am
by dick scherrer
Hello,

Be prepared for the same customer to submit the same check number more than once. . . It happens ;)

Has anyone considered storing these check images in a database?

Whether you use vsam or a database, you need to write a bit of code that reads the uploaded images one-by-one and writes them to the vsam file or the database. I'd suggest that the "key" be part of the input record that also contains the image so that this new code simply reads the file and writes to the random data (vsam or db).

Re: Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 11:31 am
by ash4u
Thanks for ur suggestions!

I tried to upload the JPG image to a PS file, being a check image, its quite big and takes more than one line records. The PS file used is FB with record length of 32756. Please suggest, if the image is taking more than one line record, can we have it stored in VSAM for a particular key? And how can i define a KSDS which will have first 16 bytes (e.g. acct number) and the rest is binary data for image?

Re: Load images to a VSAM file

PostPosted: Thu Apr 29, 2010 4:44 pm
by Robert Sample
Choosing either PDS or VSAM is a pretty bad choice for this data. It should be stored as a BLOB in a database, which does not have the record length limitations of z/OS files. If you add a sequence number to your key, then yes you can split the image into multiple records and store them in a VSAM file. However, you then have to do additional work in your application to ensure you retrieve all records and splice the image together correctly.