AbsaOSS / AbsaOSS/cobrix

Packed-Decimal columns help required in outgoing EBCDIC file

オープン
#628 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
Scala
スター
170
フォーク
96
平均マージ
57分
マージ済み PR(30日)
2

説明

## Background [Optional]
Hi,

I have requirement to create outgoing EBCDIC file (fixed width) with header, detail and footer records of length 155 bytes. I am aware that cobrix dont support writing to EBCDIC using copybooks hence I am writing dataframe to TEXT and encoding to CP037.

## Question
In my copybook (file spec) there are few columns with Packed-Decimal. I am trying to understand how numeric data can be converted into packed decimal before encoding to Cp037.

**Attribute Name = File Date
Format = S9(07) Packed Decimal (This field indicates the file creation date. The date format is Julian (YYYYDDD))
Length = 4**

I tried converting to binary and populated in file but not working when reading back using cobrix (pyspark). Please help with some examples of converting to packed decimal.

![image](https://github.com/AbsaOSS/cobrix/assets/121666022/c1d5329b-a062-41d0-bed2-9d3c0d0a6289)

For testing I am trying to create outgoing EBCDIC file and read it using cobrix in pyspark. Below is the copybook i created for reading header

01 HEADER.
10 HeaderRecordKey PIC X(32).
10 SourceStatus PIC X(01).
10 FileDate PACKED-DECIMAL PIC S9(7).
10 FileTime PACKED-DECIMAL PIC S9(11).
10 Filler PIC X(112).

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。