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

Is it possible to Sort Comp-3 type data using sort Card in J


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

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Thu Feb 14, 2008 11:34 am
Reply with quote

Is it possible to Sort Comp-3 type data using sort Card in JCL

Example:-

01 WS-DATA 9(15) comp-3.

Input
000000000000042
000000000000023
000000000000051

Output should be

000000000000051
000000000000042
000000000000023
I want to Sort on the basis of last position that is 15th position
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Feb 14, 2008 1:04 pm
Reply with quote

Your input does not look packed. The packed input can be sorted using
sort fields =(position, 08, pd, ascending/descending) into packed output. Then you would have to used edits of OUTREC to get the required output in numeric display format.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 14, 2008 9:02 pm
Reply with quote

Hello,

If your example data is the "visable" value of some packed-decimal field, you have not shown the sign. How should negatives be handled in your requirement?

Comp-3 fields can be properly sorted, but your requirement goes beyond just sorting a packed-decimal field.
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: Thu Feb 14, 2008 9:26 pm
Reply with quote

Quote:
Is it possible to Sort Comp-3 type data using sort Card in JCL


The short answer is "yes, using PD format". For more information on COBOL data types vs DFSORT formats, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603
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 Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top