Loading images/docs into a VSAM file



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Loading images/docs into a VSAM file

Postby Srinivasamurthy » Mon Mar 26, 2012 1:05 pm

What is the process to load images / documents (like PDF files..) into a VSAM file. Also how to copy it to another VSAM file?
Srinivasamurthy
 
Posts: 3
Joined: Thu Mar 22, 2012 1:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Loading images/docs into a VSAM file

 

Re: Loading images/docs into a VSAM file

Postby enrico-sorichetti » Mon Mar 26, 2012 1:50 pm

the question as posed makes little sense, too generic...

You can load/insert things according to the VSAM logic

build a record containing whatever You want and WRITE/INSERT/UPDATE the <thing>

and do not complain, please, You got what You asked for
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Loading images/docs into a VSAM file

Postby BillyBoyo » Mon Mar 26, 2012 2:20 pm

Any type of file is just data, 256 combinations per byte.

As long as the data fits within mainframe constraints, they can be put into a VSAM file.

If they don't currently fit, you can always make it so...

Don't expect to be able to double-click and read it from a batch program :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Loading images/docs into a VSAM file

Postby Srinivasamurthy » Mon Mar 26, 2012 4:36 pm

To elaborate the question further, is it possible to load the images / pdf files to a VSAM file thru a COBOL program, just like loading regular data (text and hexadecimal values) to a VSAM file. If YES, how to read images, pdf files thru the COBOL program. Any sample files and sample programs to read / write images / pdf files into VSAM files are available to view?
Srinivasamurthy
 
Posts: 3
Joined: Thu Mar 22, 2012 1:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Loading images/docs into a VSAM file

Postby Robert Sample » Mon Mar 26, 2012 4:44 pm

To elaborate the question further, is it possible to load the images / pdf files to a VSAM file thru a COBOL program
Yes, of course -- data is data is data is data. Note, however, that PDF files are frequently larger (much larger) than the typical 32760-byte record length limit of the mainframe, so your program will have to work out a way to split the PDF file into some number of records.
how to read images, pdf files thru the COBOL program
With a READ statement in COBOL -- just like any other data. PDF file data is nothing but data to COBOL.
read / write images / pdf files into VSAM files are available to view?
THAT's not going to happen -- a PDF file can be handled as an image on the mainframe through Unix System Services (I use them on my internal HTML pages at my site), but as far as I know there is no PDF viewer available for COBOL on z/OS. And since you would need a graphics device -- not the 3270 emulator software usually used to connect to the mainframe -- to even view the PDF file, there would be many, many, MANY issues in even attempting to view a PDF with a mainframe program.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Loading images/docs into a VSAM file

Postby Srinivasamurthy » Mon Mar 26, 2012 6:16 pm

Ok. I understand that it may not be possible to view the VSAM file (containing images / pdf file) in mainframe Z/OS. But is it possible to transmit / extract that VSAM file to UNIX or a different system thru FTP/NDM and view the file in the destination system. If yes, is there any sample code to transmit /extract this VsAM file to a different system?
Srinivasamurthy
 
Posts: 3
Joined: Thu Mar 22, 2012 1:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Loading images/docs into a VSAM file

Postby Robert Sample » Mon Mar 26, 2012 6:59 pm

Write a program to chop up the PDF into record-sized blocks of data and place in the VSAM file.

Write another program to read the VSAM file and rebuild the original PDF in a Unix System Services file. Your PC browser can then view the image on Unix System Services (assuming the HTTP server, or any equivalent from another software vendor, is running and has a specification for a PDF file).

Neither of these programs would be particularly hard to write in C (for example). I sincerely doubt you would find any examples since you're asking about a VERY hgihly specialized need -- but on the other hand, I've been surprised by what is available in the past.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Loading images/docs into a VSAM file

Postby enrico-sorichetti » Tue Mar 27, 2012 1:35 am

what is that is not clear?

vsam DOES not care about the content of the record, they are just sequences of bits.
the same for FTP/NDM they are just truckers who carry boxes without caring for the content.
it' s somebody' s else task to interpret those bits according to some <whatever> logic. AMEN
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post