Character to Packed Decimal coversion usinG sort



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Character to Packed Decimal coversion usinG sort

Postby djprakash1ml » Thu Aug 12, 2010 8:29 pm

How to convert PIC X(16) variable to PD?
djprakash1ml
 
Posts: 17
Joined: Mon Jun 28, 2010 6:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Character to Packed Decimal coversion usinG sort

Postby Frank Yaeger » Thu Aug 12, 2010 10:55 pm

Since you haven't given any real details about what your PIC X(16) numbers look like, I'll just assume they are ZD values. In that case, you would use DFSORT control statements something like this where p is the starting position of the field:

    OPTION COPY
    INREC BUILD=(p,16,ZD,TO=PD)


If you need more specific help, give more details including an example of the your input records and what you expect for output, the starting position, length and format of the input fields, the RECFM and LRECL of the input file, etc.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Character to Packed Decimal coversion usinG sort

Postby djprakash1ml » Fri Aug 13, 2010 1:45 pm

Thanks Frank for the response. Will go through the tutorial for more details.
djprakash1ml
 
Posts: 17
Joined: Mon Jun 28, 2010 6:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Character to Packed Decimal coversion usinG sort

Postby mainframe_babu » Fri Jun 20, 2014 11:21 am

Hi ,

could you please provide a solution for the following requirment(either in cobol programing or in JCl),

where i have input file as below format

0012500000 --- char(10)
0123450000 --- char(10)

and i need the o/p file records as below format.

001.2500000 --- s9(3)v((7) comp-3
012.3450000 --- s9(3)v((7) comp-3
mainframe_babu
 
Posts: 3
Joined: Fri Jun 20, 2014 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Character to Packed Decimal coversion usinG sort

Postby BillyBoyo » Fri Jun 20, 2014 11:35 am

Can't you just apply Frank's solution to your problem?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Character to Packed Decimal coversion usinG sort

Postby NicC » Fri Jun 20, 2014 2:31 pm

A) Do not tailgate old topics
B) It cannot be done using JCL - JCL does not manipulate data. It only tells the OS what programs you want to run and what resources/input/output they need
C) If you want a COBOL solution why not post in the COBOL part of the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Character to Packed Decimal coversion usinG sort

Postby mainframe_babu » Mon Jun 23, 2014 11:09 am

Thanks Billyboyo and NicC for the replay.

Sorry NicC for posting this in jcl form and i supposed to ask in sort step of a Jcl.(and whether is it possible in cobol?)

My questions is here , in sort where it will assume the decimal point as the below sort.

OPTION COPY
INREC BUILD=(p,16,ZD,TO=PD)
mainframe_babu
 
Posts: 3
Joined: Fri Jun 20, 2014 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Character to Packed Decimal coversion usinG sort

Postby BillyBoyo » Mon Jun 23, 2014 11:27 am

SORT makes no assumptions about decimal places. There are no implied decimal places in SORT. If calculating with decimal places in SORT, for instance, you have to do your own rearrangement if necessary.

If just moving stuff around, with a BUILD or an OVERLAY, it doesn't matter anyway. It is only when you specifically want to/need to take decimal places into account that you have to do anything.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Character to Packed Decimal coversion usinG sort

Postby mainframe_babu » Mon Jun 23, 2014 12:05 pm

Thanks Billyboyo.
mainframe_babu
 
Posts: 3
Joined: Fri Jun 20, 2014 11:06 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post