Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us