IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Replace Numeric Values using SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Sep 08, 2009 9:19 pm
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 09, 2009 9:27 pm
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 10, 2009 9:17 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top