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
 
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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 4 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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