community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

question on parsing Mainframe packed decimal and zoned decimals in Alteryx .

Highlighted
Meteoroid

Help on parsing Mainframe data.

If anybody successfully parsed mainframe packed decimal and zone decimal (Signed).   I am using .bat file to download the mainframe file using ftp into Alteryx.  

Moderator
Moderator

Hello @Ananth 


Could you include a copy of your workflow and some sample information if possible to provide some additional context into your query?

The more information you can include, the better the chances of a member of the Community being able to assist you.


Thanks,

TrevorS

Community Moderator
Meteoroid

Thanks Trevor

 

I have downloaded a mainframe (EBCDIC)  file to PC using .bat (run command).   Now the question is to parse the numeric data (packed decimal/zoned decimals with sign) which downloaded as junk in ASCII from EBCDIC format.  looking for option to parse the file.  . 

 

Packed decimal

 

Pic 9(6)v99  Comp-3 in mainframe          PD

pic  S9(6)V99.  (signed zoned decimal)  ZD

Hi,

Below is a logical aproach to solve this, that I've applied in my work

Step1 : You can either land the EBCDIC data  in bytes form from source   [ select hex(ebcdic_data)  from source_table] 

(or)

apply the code page encoding on the ASCII form of the EBCDIC data and then apply HEX function  to get HEX form of BYTES ( Eg:  Hex(Encode(ebcdic_column,'IBM500')) - where IBM500 is the codepage)

 

Step2: Once you get the HEX form of the bytes , you can write custom UDF s in python,etc  to convert the data to readable .

This is an approach I followed as PySpark script to solve this issue in my project .

 

Since Alteryx 2018.3 supports Python script , it may be a possibility to apply these UDFs in Alteryx , I have not explored this option in Alteryx  though.

Labels