View previous topic :: View next topic
|
Author |
Message |
clearskynot
New User
Joined: 21 Apr 2010 Posts: 7 Location: USA
|
|
|
|
Hello again,
I am trying to populate a value 1 into a 9(7) comp-3 field at position 10 of the output file. All records in output can have this value.
I used the below. The sort is successful and it writes value 1 to the output file. But when I use it in subsequent step in COBOL, it is failing the "IF field-name NUMERIC" condition. COBOL also uses 9(7) comp-3 field to validate.
OVERLAY=10:+1,TO=PD,LENGTH=4
Can you please help fixing this? I tried using it without the + but the sort fails.
Note:
- The hex value of this output field shows '001F'. I noticed that if it is '001C' should pass for numeric. But not sure how to do that? |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
I have no idea how what you say that you used to successfully write a 1 to your output even worked.
If you just want to overlay a position with the same PD number constant, why not simply use
Code: |
INREC OVERLAY=(10:X'001C')
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
AFAIR - SORT statements do not provide edit operations when applied to constant values. Only field “p,l” can be converted. Right now I’m sitting on my sofa, cannot check the manual.
Constants can be used to perform arithmetic operations only. |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
Quote: |
Only field “p,l” can be converted. Right now I’m sitting on my sofa, cannot check the manual.
|
Seems right. For overlay, I think TO=PD /PDC /PDF edits will work but will default to zero value.
BTW - Topic Starter states PIC 9(7) comp-3 field, my answer example only provides for a two byte packed decimal. TS would need to adjust it for the length they need. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
|