sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2023 Location: USA
|
|
|
|
haohao wrote: |
hello,
I want to convert a file'S signed packed decimal column to displayable and ftp this file from mainframe to unix.
the file's format is:
Code: |
01 RECORD
03 COL-1 PIC X(33).
03 COL-2 S9(9) COMP.
03 COL-3 PIC X(16).
03 COL-4 PIC S9(14)V999 COMP.
03 COL-5 PIC X(70).
|
I want to convert that file to this format:
Code: |
01 RECORD
03 COL-1 PIC X(33).
03 COL-2 +9(6). (this value always less than 999999)
03 COL-3 PIC X(16).
03 COL-4 +9(14).999.
03 COL-5 PIC X(70).
|
follow the previously message from this forum,I write the JCL as bellow:
Code: |
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1:1,33,
34:34,4,PD,TO=FS,LENGTH=6,
40:38,16,
56:54,8,PD,EDIT=(SIIIIIIIIIIIIIT.TTT),SIGNS=(,-),
75:62,70)
|
but it abend when executed with S0C7 abend code.
|
A maintainable in the future solution MUST be like this
Code: |
. . . . . .
//SYMNAMES DD *
COL_1,*,33,CH PIC X(33).
COL_2,*,4,FI S9(9) COMP.
COL_3,*,16,CH PIC X(16).
COL_4,*,17,ZD PIC S9(14)V999 COMP.
COL_5,*,70,CH PIC X(70).
//. . . . . .
//SYSIN DD *
SORT FIELDS=COPY SORT is done BEFORE OUTREC!!!
OUTREC BUILD=(COL_1, BUILD= is replacing obsolete FIELDS=
COL_2,EDIT=(STTTTTT),SIGNS=(+,-),
* '+' sign is mandatory in your example
* zero suppression not needed in your example
COL_3,
COL_4,EDIT=(STTTTTTTTTTTTTT.TTT),SIGNS=(+,-),
* '+' sign is mandatory in your example
* zero suppression not needed in your example
COL_5)
// . . . . . |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Do we really need so much on a topic that was started 13 1/2 years ago? The post reviving the topic should have been a new topic, not a continuation of the original. |
|