View previous topic :: View next topic
|
Author |
Message |
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
That's what I suggested in my previous posts. |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Thanks a lot Frank |
|
Back to top |
|
|
|