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
 
Is it possible to Sort Comp-3 type data using sort Card in J

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Is it possible to Sort Comp-3 type data using sort Card in J
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    Post subject:
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

Site Director


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

PostPosted: Thu Feb 14, 2008 9:02 pm    Post subject:
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 Moderator


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

PostPosted: Thu Feb 14, 2008 9:26 pm    Post subject:
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:

http://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    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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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