Focal Point
Mainframe to PC file transfer with both Alpha and packed fields

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3321069862

January 30, 2008, 04:04 PM
Lufa
Mainframe to PC file transfer with both Alpha and packed fields
Hi, I have mainframe file with records that have both Alpha and packed fields:

.MAS file to describe this file :
FILE=VISA3 ,SUFFIX=FIX,$
SEGNAME=VISA3 ,SEGTYPE=S0,$
FIELDNAME =ART-LINE ,E01 ,A2 ,A2 ,$
FIELDNAME =POLICY_IND ,E11 ,A1 ,A1 ,$
FIELDNAME =INCCNT ,E12 ,D6 ,P3 ,$
FIELDNAME =CLSCNT ,E13 ,D6 ,P3 ,$
FIELDNAME =OSAMT ,E14 ,D12.2 ,P6.2 ,$
FIELDNAME =PAIDAMT ,E15 ,D12.2 ,P6.2 ,$

Here is the problem: If I FTP file to PC with ASCII - Alpha fields are correct, but not numeric ones,
If I FTP with BINARY - numeric are correct, but alpha are wrong


FILEDEF F3 DISK \\***\***\F3.txt
TABLE FILE F3
PRINT *
WHERE RECORDLIMIT EQ 1
END

After BINARY FTP:
ññ ñ Ã -11 29 4,839.33 23,002.93

What can be done to make it work?


WebFOCUS 7.6 (in migration)
Mainframe FOCUS
Mainframe, Windows, client/server.
Output: PDFs, Excel
January 30, 2008, 05:04 PM
Francis Mariani
HOLD the file as FORMAT ALPHA or SAVE the file before ASCII FTP.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 30, 2008, 09:00 PM
Lufa
File is not created by Focus program. We are in the process of convertiong Mainframe Focus to WebFocus on client/server; we will have many files like that and no Focus before FTP( only after we FTP I can do something in WebFocus)


WebFOCUS 7.6 (in migration)
Mainframe FOCUS
Mainframe, Windows, client/server.
Output: PDFs, Excel
January 31, 2008, 06:32 AM
GamP
Maybe this will help:
1. do a binary ftp. Collect the number fields in a hold file and add a sequence number.
2. do as ascii ftp. Collect the ascii fields in a second hold file and also add the sequence number.
3. match both hold files based on the equence number.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 31, 2008, 09:35 AM
Anatess
Hi Lufa, you have mainframe focus, right? So, why not create a mainframe focus program to convert the file to format alpha and then ftp? We did this 2 years ago on all the IMS and DB2 data that migrated to PC.


WF 8.1.05 Windows
January 31, 2008, 09:47 AM
GinnyJakes
Anatess is correct, Lufa. Even if you do a binary ftp, you will always have problems with packed fields bacause of their structure. Ftp will do the ebcdic to ascii conversion one byte at a time and packed fields need to be looked at as a whole entity.

Since you have MF Focus, do what Anatess suggested and convert the packed fields to at least decimal and then do your ftp. You can send the master down as well and use both to reload your sources if they are other than ftm files.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 31, 2008, 11:42 AM
Lufa
Thank to all of you for the reply.
We will not have Mainframe Focus after conversion is complete.

I can try GamP suggestion, if I will be able to make it generic for files with different structure and different mix of Alpha and Numeric fields.


WebFOCUS 7.6 (in migration)
Mainframe FOCUS
Mainframe, Windows, client/server.
Output: PDFs, Excel
January 31, 2008, 12:11 PM
Anatess
Lufa, but you won't need Mainframe Focus after conversion is complete... because by then, all your files would have been ftp'd to PC!


WF 8.1.05 Windows
January 31, 2008, 01:31 PM
Lufa
No, Files will continue to be created on mainframe and I can't ask to change files for me, because same files are used somewhere else.


WebFOCUS 7.6 (in migration)
Mainframe FOCUS
Mainframe, Windows, client/server.
Output: PDFs, Excel
January 31, 2008, 05:18 PM
GinnyJakes
Then I think you will have to write a COBOL program or something to unpack the packed fields after the files are created.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 31, 2008, 05:29 PM
Alan B
Ginny probably has the most correct answer, but one approach I have come across is to do 2 ftp sessions, 1 binary and 1 ASCII.

Then combine the 2 files, taking the packed from the binary transferred and the alpha from the ASCII transferred to create a new file. This could be done in WF without too much hassle.


Alan.
WF 7.705/8.007
January 31, 2008, 05:41 PM
GinnyJakes
Alan,

He will still have to write a program to split up the fields and I still think he will have problems with the packed fields even if he sends then down as binary.

I haven't done this is a long time but I do remember that the packed fields were quite the challenge.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 31, 2008, 07:13 PM
Alan B
Ginny

I must admit that I thought that the packed fields would be a problem. But from his first entry he says he can TABLE out the packed fields from the binary transfer. I came across this idea eons ago but never tried it.

That being so, then there should not be a problem!

But I do agree with you that the responsibility for data conversion should be on the MF.


Alan.
WF 7.705/8.007
February 01, 2008, 10:05 AM
Tony A
Lufa,

Do you have something like SELCOPY on mainframe? This could be an alternative to getting a COBOL prog written to convert the file.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10