View previous topic :: View next topic
|
Author |
Message |
deepak_munjal
New User
Joined: 30 May 2008 Posts: 43 Location: Mumbai
|
|
|
|
Hi Everyone...,
I am looking to FTP the a flat file, which contains COMP and COMP-3 feilds, to Oracle team out here...
So i need to Unpacked the COMP & COMP-3 fields so that they can receive the data in pure numeric and character format in the file.
I have search this post but sorry to say i didn't get much as i am pretty new to mainframes....
www.ibmmainframes.com/viewtopic.php?t=41628&highlight=unpacked+data
Please see below the layout of the file:-
01 WS-AP215-REC.
02 WS-AP215-ACCTNO PIC X(08).
02 FILLER PIC X(16).
02 FILLER COMP.
03 FILLER PIC S9(9).
03 FILLER PIC S9(9).
03 FILLER PIC S9.
02 FILLER PIC S999 COMP.
02 HFO-PXADDR-OLD PIC S9999 COMP.
02 HFO-REGION PIC 9.
02 WS-AP215-CUSIP PIC X(9).
02 FILLER PIC X(4).
02 FILLER PIC S9(5)V999 COMP.
02 HFO-NR-ADDS PIC S9.
02 HFO-IND PIC X(3).
02 HFO-DESCR PIC X(24).
02 WS-AP215-SECNO2 PIC X(5).
02 HFO-CSH-SPV PIC S9(13) COMP-3.
02 HFO-CM-REC.
03 HFO-TYPE PIC X.
03 HFO-AUTO PIC X.
03 HFO-MPCT PIC S9V999 COMP.
03 HFO-SDTE PIC S9(9) COMP-3.
03 HFO-1031Q PIC S9(17) COMP.
03 HFO-1031Q-R REDEFINES HFO-1031Q PIC 9(17) COMP.
03 WS-AP215-CSH-1028 PIC S9(17) COMP.
03 HFO-SEGQ PIC S9(9) COMP.
03 FILLER PIC X(29).
03 HFO-1028S PIC S9(11)V99 COMP-3.
02 HFWA-CSH-OFCOSHP PIC XXX.
02 F PIC X(15).
Can you please let me how to convert the file ?
Can i get the field value with sign and decimal like eg:-
For S9(4)v9(3) COMP or S9(4)v9(3) COMP-3 ==> Fields comes out to be like ==> -2345.678 ==> that is with sign and decimal point.
I hope you understand what i am looking for.
Thanks in advance, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
deepak_munjal
New User
Joined: 30 May 2008 Posts: 43 Location: Mumbai
|
|
|
|
I understood for sort statements on comp,comp-3, 999, XX kind of data types... But for can you tell me about S9 ?
Please confirm me....
what kind of the sort statement for
02 HFO-NR-ADDS PIC S9.
Copybook:-
01 WS-AP215-REC.
02 WS-AP215-ACCTNO PIC X(08).
02 FILLER PIC X(16).
02 FILLER COMP.
03 FILLER PIC S9(9).
03 FILLER PIC S9(9).
03 FILLER PIC S9.
02 FILLER PIC S999 COMP.
02 HFO-PXADDR-OLD PIC S9999 COMP.
02 HFO-REGION PIC 9.
02 WS-AP215-CUSIP PIC X(9).
02 FILLER PIC X(4).
02 FILLER PIC S9(5)V999 COMP.
02 HFO-NR-ADDS PIC S9.
02 HFO-IND PIC X(3).
02 HFO-DESCR PIC X(24).
02 WS-AP215-SECNO2 PIC X(5).
02 HFO-CSH-SPV PIC S9(13) COMP-3.
02 HFO-CM-REC.
03 HFO-TYPE PIC X.
03 HFO-AUTO PIC X.
03 HFO-MPCT PIC S9V999 COMP.
03 HFO-SDTE PIC S9(9) COMP-3.
03 HFO-1031Q PIC S9(17) COMP.
03 HFO-1031Q-R REDEFINES HFO-1031Q PIC 9(17) COMP.
03 WS-AP215-CSH-1028 PIC S9(17) COMP.
03 HFO-SEGQ PIC S9(9) COMP.
03 FILLER PIC X(29).
03 HFO-1028S PIC S9(11)V99 COMP-3.
02 HFWA-CSH-OFCOSHP PIC XXX.
02 F PIC X(15). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
S9 is equivalent to a 1-byte ZD field so you could use something like:
Code: |
p,1,ZD,EDIT=(ST),SIGNS=(+,-)
|
|
|
Back to top |
|
|
deepak_munjal
New User
Joined: 30 May 2008 Posts: 43 Location: Mumbai
|
|
|
|
Thanks Frank....
Appreciate your help...
Just one more thing i wanna ask... If we wanna show a exact value which is stored in the COMP-3 or COMP value. then what would be the data type of output fields used ?
for ex.:-
One field of input file has - S9(15)V9(2) COMP-3 = -012345678912345.22
Second field of input file has- S9(10)V9(4) COMP = -0123456789.2233
Now i want to move the value in out put file so that when i open the output file it will show me the exact value of every comp-3/comp feilds i.e. For first field <-012345678912345.22> and <-0123456789.22
33>for second field.
I hope you understand. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Well, I understand but there's really no built-in functions to do that.
DFSORT has no knowledge of those declarations or any ability to translate them into output edit masks automatically. You could use the REXX program from the "Create DFSORT Symbols from COBOL Copybook" Smart DFSORT Trick at:
www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000094
to create DFSORT Symbols, but the resulting symbols will only get you the DFSORT input formats (ZD, PD, etc). You are talking about "output formats" which DFSORT does with edit masks. I don't know of any tool to generate the correct edit masks from the COBOL copybook. You would have to specify the correct edit masks yourself based on the original COBOL declaration. |
|
Back to top |
|
|
|