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
 

 

SORT packed decimal field which is S9(6) PACKED DECIMAL

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

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 04, 2007 10:55 pm    Post subject: SORT packed decimal field which is S9(6) PACKED DECIMAL
Reply with quote

We need the following:

Input file has a packed decimal field which is S9(6) PACKED DECIMAL.

The output also should have the same declaration.

Input file has 4 bytes length and the output file should have 2 bytes.

For eg : Input has a record value 31000
the output file should have value 031.

Both of them should be packed decimal / COMP-3 only.

Can anyone help in this regard.

Thanks in advance.

Regards,
Anitha
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: Mon Jun 04, 2007 11:33 pm    Post subject:
Reply with quote

Are you saying you have a 4-byte PD field with 6 digits and you want to divide it by 1000 to get a 2-byte PD field with 3 digits?

You say input and output should have the same declaration, but then you say the input has 4 bytes, and the output should have 2 bytes ... that seems like a contradiction. If the output is only 2 bytes, it can't have S9(6) PACKED DECIMAL as its declaration since that takes 4 bytes. It could have S9(3) PACKED DECIMAL.

Please clarify what you want.
Back to top
View user's profile Send private message
Anithals

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 04, 2007 11:48 pm    Post subject:
Reply with quote

Hi,

I will rephrase the question.

The input and output should have the declaration S9(6) packed decimal.
But the value should change.
For eg: 31000 to 031

Please suggest.

Regs,
Anitha
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: Tue Jun 05, 2007 12:42 am    Post subject:
Reply with quote

You can use these DFSORT control statements:

Code:

   OPTION COPY
   INREC OVERLAY=(1:1,4,PD,DIV,+1000,TO=PD,LENGTH=4)


If your input record has X'0031000C', your output record will have X'0000031C'.
Back to top
View user's profile Send private message
Anithals

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Tue Jun 05, 2007 7:08 pm    Post subject:
Reply with quote

Hi,

Thanks. Its working now.

Regs,
Anitha
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