MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert Numeric to packed decimal(comp-3) in Sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
coolguy
Beginner


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Thu Jul 28, 2005 2:26 am    Post subject: Convert Numeric to packed decimal(comp-3) in Sort Reply with quote

I have Flat file which contains the arry
Input
Code:

10  ws-ARRAY.      
    15 ws-CHARGE OCCURS 10 TIMES   PIC 9(07)V99.   

I want to convert Pic 9(07)v99 to PIC S9(07)V99 COMP-3.
output
Code:

10  ws-array.   
    15 ws-CHARGE OCCURS 10 TIMES   PIC S9(07)V99 COMP-3.

Is it possible by Sort ? can u help in that

Cool
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 28, 2005 3:16 am    Post subject: Reply with quote

Coolguy,

This should help you.
Code:

//R010   EXEC  PGM=SORT                   
//SORTIN   DD  *                         
123456789012345678123456789012345678
//SORTOUT  DD  SYSOUT=*                   
//SYSOUT   DD  SYSOUT=*                   
//SYSIN    DD  *                         
  SORT FIELDS=COPY                       
  OUTREC FIELDS=(01,9,ZD,TO=PD,
                 10,9,ZD,TO=PD,
                 19,9,ZD,TO=PD,
                 28,9,ZD,TO=PD)   
/*                                       


ZD - Zoned Decimal (9(07)V99)
PD - Packed Decimal (S9(07)V99-COMP3)

You can convert a numeric value to Packed numeric using OUTREC/INREC statement. You can either use 'ZD,TO=PD' or 'ZD,PD' depending upon the Sort product/version your shop has.

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
coolguy
Beginner


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Thu Jul 28, 2005 7:57 am    Post subject: Reply with quote

Thanks Phantom thanks for your help
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Jul 28, 2005 11:38 am    Post subject: Reply with quote

Quote:
You can either use 'ZD,TO=PD' or 'ZD,PD' depending upon the Sort product/version your shop has.


DFSORT supports both of these forms, but ZD,TO=PD is recommended to avoid ambiguity when using DFSORT symbols.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group