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

Write 9(07) comp-3 data into output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
clearskynot

New User


Joined: 21 Apr 2010
Posts: 7
Location: USA

PostPosted: Thu Apr 16, 2020 11:00 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Apr 17, 2020 2:03 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Fri Apr 17, 2020 2:12 am
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Apr 17, 2020 2:35 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Apr 17, 2020 7:51 am
Reply with quote

OUTREC control statement
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top