Page 1 of 1

Comp-3 fields Conversion

PostPosted: Wed Dec 07, 2022 11:45 am
by naga821
Hi All,

I have a mainframe file which has 400+ columns are COMP-3 fields. Please let me know to convert all COMP-3 fields to readable format ( CSV or excel ). Appreciate your response.

Thanks,
Naga.

Re: Comp-3 fields Conversion

PostPosted: Wed Dec 07, 2022 9:30 pm
by sergeyken
naga821 wrote:Hi All,

I have a mainframe file which has 400+ columns are COMP-3 fields. Please let me know to convert all COMP-3 fields to readable format ( CSV or excel ). Appreciate your response.

Thanks,
Naga.

It depends on: which tool you are planning to use for this conversion (out of 100500 of available tools)??

BTW, there are no "files" on mainframe. There are "datasets"

P.S. It is almost unrealistic to convert your data to the actual "EXCEL format"; you might need to re-invent significant part of the internal code of MS Excel program itself. It makes no sense. But CSV is possible, in many different ways. All depends on: what you are familiar with? :?:

P.P.S.
The data on mainframe are all in EBCDIC codepage, but where Excel is used, all data are (usually) in ASCII code page. Did you hear about those terms?

Re: Comp-3 fields Conversion

PostPosted: Fri Dec 09, 2022 4:18 pm
by prino
On the small white box side you could probably do this with two or so dozen lines of REXX (Regina, ooREXX), by parse each record into stem variables, and loop through the stems using the various X2Y conversion routines.

Re: Comp-3 fields Conversion

PostPosted: Sat Dec 10, 2022 2:30 am
by sergeyken
As for myself, I’d prefer using SORT utility in this situation


//PD2CSV EXEC PGM=SORT
. . . . . . . . .
//SYMNAMES DD *
F001,PD,*,5
F002,PD,*,10
F003,PD,*,15
. . . . . . . . .
F400,PD,*,10
//*
//SORTIN DD . . . . . . .
//SORTOUT DD . . . . . . .
//SYSIN     DD  *
 SORT FIELDS=COPY
 OUTREC BUILD=(F001,Mx,      choose Mx for most acceptable format
          C’,’,F002,Mx,
          C’,’,F003,Mx,
          . . . . . . .,
          C’,’,F400,Mx)
//*