IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to convert decimal to comp-3 format and also comp format


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Tue May 02, 2006 4:40 pm
Reply with quote

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

DFSORT Developer


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

PostPosted: Tue May 02, 2006 8:01 pm
Reply with quote

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

New User


Joined: 28 Jul 2006
Posts: 7
Location: Hartford

PostPosted: Wed Aug 23, 2006 2:10 am
Reply with quote

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

DFSORT Developer


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

PostPosted: Wed Aug 23, 2006 2:18 am
Reply with quote

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

New User


Joined: 16 May 2008
Posts: 36
Location: Kolkata,India

PostPosted: Mon Sep 07, 2009 7:21 pm
Reply with quote

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

Code:
44827937090721105{


Where as it should have been
Code:
448279370907211050


Can you help on how can I replace the last bye to equvalent decimal value "0" in this case?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Sep 08, 2009 3:06 am
Reply with quote

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

New User


Joined: 16 May 2008
Posts: 36
Location: Kolkata,India

PostPosted: Tue Sep 08, 2009 5:51 pm
Reply with quote

Thanks Frank..
I got it done ..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top