Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Convert the COMP and COMP-3 feilds to Numeric fields....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
deepak_munjal

New User


Joined: 30 May 2008
Posts: 43
Location: Mumbai

PostPosted: Wed Jul 08, 2009 10:01 pm    Post subject: Convert the COMP and COMP-3 feilds to Numeric fields....
Reply with quote

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....
http://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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jul 08, 2009 11:20 pm    Post subject:
Reply with quote

See the following:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/C.3?DT=20080528171007

As shown, COMP is equivalent to BI (unsigned) or FI (signed) and COMP-3 is equivalent to PD.

You can edit these fields with appropriate DFSORT edit masks, e.g.

p,m,PD,EDIT=(STTTT.TTT),SIGNS=(+,-)

where p is the starting position (e.g. 11), m is the length (e.g. 4) and PD is the format (or BI or FI as appropriate).

For more information, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG30/2.4.8?DT=20080529102039
Back to top
View user's profile Send private message
deepak_munjal

New User


Joined: 30 May 2008
Posts: 43
Location: Mumbai

PostPosted: Thu Jul 09, 2009 12:52 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 09, 2009 12:57 am    Post subject:
Reply with quote

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
View user's profile Send private message
deepak_munjal

New User


Joined: 30 May 2008
Posts: 43
Location: Mumbai

PostPosted: Thu Jul 09, 2009 3:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 09, 2009 4:10 am    Post subject:
Reply with quote

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:

http://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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us