Has anyone developed a service to unpack a packed-decimal?
It’s not in IS services, but I have Java code that works with packed decimal, converting to/from BigDecimal. Could easily be packaged into IS services.
Got anything to trade?
David: Do you still need somthing to handle packed-decimals?
can u send me that java code that converting to/from bigdecimal
Can I get that code please?? I’m picking up where David left off and I have a need to convert ASCII numbers to packed decimal format in webMethods before converting to EBCDIC format. Any help is greatly appreciated.
Hello all.
We have an integration that needs to retrieve mainframe sequential data sets from the mainframe. These datasets contain some packed fields.
What is the “best” way to get these (EBCIDIC) files into the integration server (ASCII) and how do we handle the packed fields ? Should we get the files using webMethods FTP ? (if so what mode ?)
I’m sure many people have done this before. A summary of what you did would be great. Also if any custom code is required can you please share ?
Thanks very much!
Wayne
The best way to go is to use the webMethods mainframe adapter. There are some java services that convert packed decimals that are delivered as Samples with the adapter. If you can’t find anyone to help you on the mainframe - like a cobol programmer, then you have to FTP the file in Binary mode and convert to EBCDIC on the webMethods server. I wrote some java services that do this.
I took the Sample (Comp-3) MainframeSampleServices.Conversion.convertPackedDecimal:ConvertPackedDecimalToString and added a parameter to let me pad with zeros and handle a 0. The sample only handles greater than zero. I also wrote another java service to handle signed amount fields
(not comp or comp-3 or 4) and have it output the sign and the number seperately. I also had to divide up the input file into records, and chunks using the Byte array. The character fields could be converted using pub.string:bytesToString with CP037 as the encoding and the numbers had to be handled in my java services. Anyway, it works and runs pretty fast too. My ftp uses the quote site command with LRECL 814 and then I divide the file into 814 byte records, loop thru the records and divide up the record into 14 or 25 chunks depending on the 34th character, then build my document using bytesToString and my java services and write it to an Ascii file.
Jon, thanks for the information.
Can you please clarify how the wM mainframe adapter would be used ? Is this mentioned in the docs ? Do you mean the wM Mainframe SERVER ? (I thought it could only access CICS and IMS…)
Regarding the solution using FTP and Binary mode. Did you mean to say “convert to ASCII on the webMethods server” ? Can you share the services you used to used to convert the data after you receive it in binary mode ?
Anything you can share would be appreciated.
Regards,
Wayne
The answer is yes. You can use JES Publish in the webMethods Mainframe server to send data from the mainframe from a flat file (or VSAM) through SNA. It only requires a small cobol program that the file writes to the JES Spool.
To move data from the IS to a mainframe flatfile using the webMethods Mainframe server, you have to set up a CICS transaction and program to recieve the data. You can use sockets and a TDQ or several other methods.
When you FTP in binary mode from the mainframe you can convert to Ascii on the IS. Then you can use the sample conversion java services delivered with the webMethods Mainframe server to convert packed (comp-3) numbers.
Thanks for the feedback Jon!
Wayne