Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL to convert decimal to comp-3 format and also comp format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: JCL to convert decimal to comp-3 format and also comp format
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 Moderator


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

PostPosted: Tue May 02, 2006 8:01 pm    Post subject:
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.

http://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:

http://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    Post subject: Re: JCL to convert decimal to comp-3 format and also comp fo
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 Moderator


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

PostPosted: Wed Aug 23, 2006 2:18 am    Post subject:
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    Post subject: Reply to: JCL to convert decimal to comp-3 format and also c
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 Moderator


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

PostPosted: Tue Sep 08, 2009 3:06 am    Post subject:
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    Post subject: Reply to: JCL to convert decimal to comp-3 format and also c
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    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 Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us