Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

FTP a IMG file into mainframes in a flat file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Fri Sep 21, 2007 11:46 pm    Post subject: FTP a IMG file into mainframes in a flat file
Reply with quote

Hi, Did any one work on IMG files. I am trying to FTP a IMG file into mainframes in a flat file and then trying to copy it to VSAM file. But i am not able to FTP the file into mainframes. If anybody worked on it before please share your knowledge

When i try to FTP it in Binary mode it fails with timeout error
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2007 12:11 am    Post subject:
Reply with quote

Hello Radha and welcome to the forums,

As i saw nothing in your request that was COBOL oriented, i moved your question to this part of the forum.

What is the size and content of your IMG file?

If it is a win-based graphic file, it will probably not go directly into a vsam file. How familiar are you with vsam?
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Sat Sep 22, 2007 12:34 am    Post subject: Reply to: Reg IMG files
Reply with quote

Hi ,

Thank you for the response. Ths size of file is 241KB, The contents are

It has first 12 bytes of a numeric key to identify the Image and next field is the Image(I do not know the length of this field). The requirement is that I need to read this IMG file after copying it to VSAM file with Key of first 12 bytes, get the image and update into another VSAM file

My experiance with VSAM files is simple operations like creating,reading and updating
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2007 1:52 am    Post subject:
Reply with quote

You're welcome.

Has anyone on your system done anything like this or is this the first attempt?

How was this 241k file built? How did 12 bytes of "key" info get placed in the file "in front of" the actual image?

If this image is transferred to the mainframe, how will it be used there?
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Sat Sep 22, 2007 3:10 am    Post subject: Reply to: Reg IMG files
Reply with quote

I will have to talk to the person who created this file and will get back to you with answeres to your questions
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Tue Sep 25, 2007 2:10 am    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Hi Dick Sherrer,

Here are the answeres for your questions.

1. This is first time we are doing this kind of task in our bank. We have a existing process but it uses a utility and have very less knowledge how it works and it is a package took on lease which will expire next year so we are trying to build this functionality in house

2. The images of checks for a perticular bank will come to our system and a system called ATRIL will load those images into SQL server with extension .TIF These images are fetched thru a VB program and this VB program will create the IMG file. The first 12 bytes of Image Key is taken from the Image name when it is fetched from SQL database and so this is how it is created. The other part of story is we will also create a statement for the same bank in AFP format which is Variable length file created by a utility MCCD in a JCL. So, this AFP file will have this Image key which i will read and go across the IMG file and fetch the Image of this perticular statement and place it back in AFP file. I hope i did not confuse you

Please let me now if you need any further details apart from this. I am attaching a sample IMG file with One record for your perusal after copying it to Notepad. I asked the VB programmer to write the Length of IMage in the file. So, first 12 bytes are Image key and a hyphen then length of image and hyphen and then the Image.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 25, 2007 2:21 am    Post subject:
Reply with quote

Hello,

What is the plan to use this data once it is stored in a vsam file?

It will not display on a CICS screen. . . .
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Tue Sep 25, 2007 2:26 am    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Hi,

We will not use the VSAm file on CICS screens. The VSAM file is just used to fetch the Image for a perticular Image key and store the image in corresponding record on AFP file and This AFP file will be printed to generate the bank statement
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 25, 2007 2:45 am    Post subject:
Reply with quote

Hello,

How is the interface to the AFP file implemented?

What do you provide to the "add" to AFP?

It is sounding like you will need to split the IMG file into pieces before uploading them and recombine them out of VSAM before presenting them to the AFP add.

This will depend on how the add to AFP is accomplished.
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Tue Sep 25, 2007 7:45 pm    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Hi,

The AFP file will be generated thru a JCL by using a utility program and the file will be a variable length record file. So, I will read the Image Key from this AFP file and search that in the IMG VSAM file to fetch the IMAGE

Then I will write a new AFP file with Image by creating a new AFP file

Hope I answered your question.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 25, 2007 8:11 pm    Post subject:
Reply with quote

Hello,

Quote:
Hope I answered your question
I believe you did icon_smile.gif

Yes, i'd look into having the IMG file split into multiple fixed length "records" before transferring it to the mainframe. Each of these "pieces" would contain the key and maybe the "piece number" (i.e. 1, 2, . . .n).

The fixed length pieces will ftp without problem and they will also load into the vsam file easily. When you use the data, the pieces would be re-combined prior to sending the image to AFP.

Keep in mind that the ftp needs to be done in binary to preserve the image.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Sep 25, 2007 10:31 pm    Post subject:
Reply with quote

Dick,

If the ftp is in binary and the key data is in ascii hex format the key portion of the record won't be in clear text on the mainframe. I can offer a solution of writing the key file and img file seperate and ftping the key file as ascii and the image file as binary.

I doubt you can implement this solution but I think it would be better:
I seems to me that using VSAM for the image stores is putting extra parts into the system. If DB2 was used to store the images, you could get away with this just a hair easier on the mf side.

The VB program could read them from SQL and write them into DB2 directly. That assumes quite a few things are in place such as LAN connection to the mainframe DB2 systems that are needed and drivers for VB to talk to DB2 on the mainframe. That way the VB programmer could read the data right out of SQL Server and insert it directly to DB2 for use.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 26, 2007 12:30 am    Post subject:
Reply with quote

Hi Steve,

Quote:
It seems to me that using VSAM for the image stores is putting extra parts into the system"
I agree, but i'm not completely clear on why vsam is being used.

Quote:
That assumes quite a few things are in place
I've been trying to use what was already available without introducing radically different approaches.

For initial testing, i wasn't worrying about the "key" being in clear text. Once we were able to load an image into vsam and get it back to AFP, i was going to deal with that.
Quote:
I can offer a solution of writing the key file and img file seperate and ftping the key file as ascii and the image file as binary.
This may work well as long as there is something to syncronize the 2 files. If each run uploads multiple check images in multi-record sets, it will be necessary to keep things "together", but that should not be a show-stopper.

Directly accessing db2 might work, but Radha will have to let us know if that is worth pursuing.
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Wed Sep 26, 2007 7:26 pm    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Steve\Scherrer

Thanks for your valuable inputs and suggestions. I was talking to my lead on DB2 option and we are positively thinking on this option. We still have to involve some more people to conclude on this. I will let you know once we conclude on this.

We might go for DB2 option.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 26, 2007 9:55 pm    Post subject:
Reply with quote

Good luck icon_smile.gif

We'll be here if there are questions.
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Wed Sep 26, 2007 10:53 pm    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Thank you icon_biggrin.gif
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Sat Sep 29, 2007 12:12 am    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

Hi Scherrer,

We tried with one more alternative. The IMG file was stored in a server and i used a FTP jcl to pull it into a variable length record and it worked
and i stored the data in binary mode in a variable file.

Now the question is what record length should i give for the file so that i will FTP the file properly

in today's sample file case i knew the maximum record length and i gave the same for the variable file while doing FTP

So is there any maximum length that i can give for a variable record file?

Below is my JCL

//STEP01 EXEC PGM=FTP,REGION=4M
//SYSI040 INCLUDE MEMBER=SYSI040
//SYSPRINT DD SYSOUT=*
//SYSPUT DD SYSOUT=*,DCB=BLKSIZE=0
//INPUT DD DISP=SHR,DSN=BPTSO.PR33785.LIB(SUN)
// DD *
cd /local/data/meta/encrypt/in
bin
LOCSITE RECFM=VBA CYL PRI=1 SEC=1 LRECL=39898 BLOCKSIZE=0
GET imagefile 'BPTN.RTD.ADS.img.file2.bin' (REPLACE
QUIT
Back to top
View user's profile Send private message
MRADHA

New User


Joined: 20 Sep 2007
Posts: 11
Location: San Juan

PostPosted: Sat Sep 29, 2007 12:30 am    Post subject: Reply to: FTP a IMG file into mainframes in a flat file
Reply with quote

I am sorry what i said is in correct. Even though i gave 39894 as record length the jcl created a file with only 256 record length and the data was scrolled to next record. so, the image was stored as multiple records

i think this may not work. sorry for the earlier mail
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Sat Sep 29, 2007 12:31 am    Post subject:
Reply with quote

Were you able to view the file and confirm it was indeed 39898 large? I have found that when you go beyond the ~32k lrecl, most tools can't view the contents of the file.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 29, 2007 12:34 am    Post subject:
Reply with quote

Hello Radha,

What you ask is why i suggested splitting the image into "known" sized pieces before the transfer.

So far, i've not changed the length of the mainframe receiving file dynamically. Something else you may need to consider is when the image file is longer than you can write into a mainframe record.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us