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

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

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: 2567
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 Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
No new posts Checking the total counts inside a re... JCL & VSAM 5
Search our Forums:

Back to Top