View previous topic :: View next topic
|
Author |
Message |
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 14
|
|
|
|
Hi,
I need a SORT JCL to convert Decimal values to COMP-3
and also another SORT JCL to convert Decimal to COMP formats.
Please help me out.
Sandhya |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
See the "What are the equivalent DFSORT formats for various COBOL data types?" Ask Professor Sort" item for a table showing the corresponding DFSORT formats for various COBOL formats.
www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/
I'm guessing by "decimal", you mean ZD. COMP-3 is PD. COMP is BI or FI.
To convert from one format to another, you can use an INREC, OUTREC or OUTFIL item like this:
p,m,f,TO=fo,LENGTH=n
where p is the input starting position, m is the input length, f is the input format, fo is the output format and n is the output length. For more information and an example, see "Reformatting Features" - "Reformatting: Numeric Conversion" in my Beyond Sorting paper at:
www.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/
If you need more specific help, give the details of exactly what you want to do. |
|
Back to top |
|
|
Newton
New User
Joined: 28 Jul 2006 Posts: 7 Location: Hartford
|
|
|
|
Looking for vice-versa of this (coverting Comp-3 to normal decimal values)
Pls note: Link mentioned in prior post are not working. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Pls note: Link mentioned in prior post are not working. |
I've replaced individual pages on the DFSORT website with pdf files. I've updated the links in the prior post. |
|
Back to top |
|
|
Kamlesh Kamal
New User
Joined: 16 May 2008 Posts: 36 Location: Kolkata,India
|
|
|
|
Hi Frank,
Using your sugestion I am able to convert a PD to ZD but there is a problem in one byte (the last byte) I am getting a hex equivalent there.Here is exactly what is happening.
My comp 3 field is defined like
Code: |
01 DCLTCMLOB-TRAN-ERR-OUT.
10 LFE-LOB-TRAN-ID PIC S9(18)V COMP-3. |
My sort card is
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,10,PD,TO=ZD,LENGTH=18) |
The output is dispayed as
Where as it should have been
Can you help on how can I replace the last bye to equvalent decimal value "0" in this case? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
When I run your job with DFSORT, I get the value you say you want:
448279370907211050
So I suspect you're using Syncsort, not DFSORT. Look at the //SYSOUT messages - WER message indicate Syncsort (ICE messages indicate DFSORT).
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
Kamlesh Kamal
New User
Joined: 16 May 2008 Posts: 36 Location: Kolkata,India
|
|
|
|
Thanks Frank..
I got it done .. |
|
Back to top |
|
|
|