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
 
Replace Numeric Values using SORT

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

New User


Joined: 01 Aug 2007
Posts: 50
Location: Hosur

PostPosted: Tue Sep 08, 2009 7:19 pm    Post subject: Replace Numeric Values using SORT
Reply with quote

I need the following to

Code:

LEVEL-NBR              ELEMENT-NBR         DESCRIPTION
4/NUM                 9/NUM                    22/AN                 
(724-727)            (728-736)               (737-758)             
75------------------ 76-------------------- 77--------------------
                  10                     90 MID-ATLANTIC         



to appear as

Code:

LEVEL-NBR               ELEMENT-NBR         DESCRIPTION
4/NUM                 9/NUM                    22/AN                 
(724-727)            (728-736)               (737-758)             
75------------------ 76-------------------- 77--------------------
                  10                     107 MID-ATLANTIC         



I should based on a Key which is also NUM of length 9 say for example "611"


I tried using OVERLAY, but didnt get the exact output.

Code:

OPTION COPY                             
INREC IFTHEN=(WHEN=(2,10,ZD,EQ,+611),   
OVERLAY=(728:C'107'))                   


I know using Char for replace is not correct, but didnt get the exact way
Can anyone help me?

Thanks!
alan
B'lore
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 Sep 08, 2009 9:19 pm    Post subject:
Reply with quote

If you use OVERLAY=(728:C'107'), you'll get '107' in positions 728-730.

If you want '107' in positions 734-736 preceded by blanks, you can use OVERLAY=(728:6X,C'107')

Quote:
I should based on a Key which is also NUM of length 9 say for example "611"


If it's length 9, why are you using 2,10,ZD instead of 2,9,ZD?
Back to top
View user's profile Send private message
alan_blore

New User


Joined: 01 Aug 2007
Posts: 50
Location: Hosur

PostPosted: Wed Sep 09, 2009 12:13 pm    Post subject: Replace Numeric Values using SORT
Reply with quote

Thanks frank

My doubt is -
Is it fine to overlay a Numeric field with Characters, will it not affect the processing down the line

And it was a typo to mention length 9, it is 10 (Num) and so I'm using 2,10,ZD

Is that the right way to use the condition?

Code:

INREC IFTHEN=(WHEN=(2,10,ZD,EQ,+611),


Thanks
alan
B'lore
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: Wed Sep 09, 2009 9:27 pm    Post subject:
Reply with quote

Quote:
Is it fine to overlay a Numeric field with Characters, will it not affect the processing down the line


It's not clear what you're asking.

I don't know what "9/NUM" means. Is it a 9-byte ZD field or something else?

If you want to create an n byte ZD field with the value '107', you can do it like this:

Code:

   +107,TO=ZD,LENGTH=n


If you want something else, you have to be clear about what you want.

Quote:
Is that the right way to use the condition?


That's valid syntax.
Back to top
View user's profile Send private message
alan_blore

New User


Joined: 01 Aug 2007
Posts: 50
Location: Hosur

PostPosted: Thu Sep 10, 2009 7:53 pm    Post subject:
Reply with quote

Thanks Frank,

I meant '9/NUM' as PIC 9(09).

Correct me if I'm wrong - my OVERLAY condition can be:

For Numeric of length 9 - PIC 9(09):

Code:

OVERLAY=(728:+107,TO=ZD,LENGTH=9)


For String of length 9:

Code:

OVERLAY=(728:6X,C'107')


Thanks
Alan
B'lore
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 Sep 10, 2009 9:17 pm    Post subject:
Reply with quote

That's what I suggested in my previous posts.
Back to top
View user's profile Send private message
alan_blore

New User


Joined: 01 Aug 2007
Posts: 50
Location: Hosur

PostPosted: Fri Sep 11, 2009 1:52 am    Post subject:
Reply with quote

Thanks a lot Frank
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 OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

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