IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FTP a IMG file into mainframes in a flat file


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2007 12:11 am
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
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2007 1:52 am
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
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 25, 2007 2:21 am
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 25, 2007 2:45 am
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
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

Moderator Emeritus


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

PostPosted: Tue Sep 25, 2007 8:11 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 26, 2007 12:30 am
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 26, 2007 9:55 pm
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Sat Sep 29, 2007 12:34 am
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
MRADHA

New User


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

PostPosted: Sat Sep 29, 2007 3:03 am
Reply with quote

Yes Scherrer. Also, i tried to create a VBA file with 32760 as LRECL and it created the file and when i try to create the file with more than 32760 it started giving error saying LRECL exceeds maximum length. So, I concluded that file cannot exceed the 32760 length

So, we are trying for some more alternatives like making sure the IMAGE size is not greater than 10K bytes and so on. I need to do some testing and will post you with updates
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Sep 29, 2007 3:11 am
Reply with quote

Good luck icon_smile.gif

We're here when you'd like to "chat" about alternatives.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Sun Sep 30, 2007 7:29 pm
Reply with quote

You can indeed have records beyond 32760, you need to give a RECFM=U (I think) look up spanned records for VSAM
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Oct 01, 2007 2:03 am
Reply with quote

Hello,

While vsam can handle the larger record(s), i'm not sure how to get them transferred from the remote to the mainframe "in one piece".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top