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
 

 

How to select few bytes from a packed field using SORT.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Thu May 14, 2009 10:08 pm    Post subject: How to select few bytes from a packed field using SORT.
Reply with quote

Dear All

I have one requirement where i need first few bytes of a packed formatted data field for all of records.
Ex:
Brand Name - S9(7) comp-3( value AAAAAAA)
Product ID- S9(17) comp-3( value 12300000000000000)

The above data should show in my output as
AAAAAAA 123.

I tried doing:
OUTREC FIELDS=(1,4,PD,ZD,X,5,3,PD,ZD)
BUT IT GIVES AAAAAAA 01230

Please let me know how can this be achieved in SORT and let me know if any further info is required.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu May 14, 2009 10:41 pm    Post subject:
Reply with quote

Quote:
Brand Name - S9(7) comp-3( value AAAAAAA)


No comment!
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Thu May 14, 2009 10:52 pm    Post subject:
Reply with quote

That was a horrible mistake in a hurry - changing it to
Account No- S9(7) comp-3 (1111111)
Product Id- S9(17) comp-3.(12300000000000000)
should appear- 1111111 123
Let me know if anything is required.Thanks.
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 May 14, 2009 11:27 pm    Post subject:
Reply with quote

You can use this DFSORT OUTREC statement to do what you asked for:

Code:

   OUTREC FIELDS=(1,4,PD,ZD,X,5,2,PD,EDIT=(TTT))
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Fri May 15, 2009 1:06 pm    Post subject:
Reply with quote

Thanks Frank. You are always the last person to close it:).
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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