Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Write 9(07) comp-3 data into output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Write 9(07) comp-3 data into output file
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: 40
Location: NY

PostPosted: Fri Apr 17, 2020 2:03 am    Post subject:
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: 857
Location: Maryland

PostPosted: Fri Apr 17, 2020 2:12 am    Post subject:
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: 40
Location: NY

PostPosted: Fri Apr 17, 2020 2:35 am    Post subject:
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: 2484
Location: NY,USA

PostPosted: Fri Apr 17, 2020 7:51 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing Data Type tgwacker50 SYNCSORT 4 Mon Oct 19, 2020 9:06 pm
No new posts Hex Value - vb file replace old date ... premnath DFSORT/ICETOOL 10 Sat Oct 17, 2020 3:15 am
No new posts Related to using a file in comparison Kumar Sandeep JCL & VSAM 4 Fri Oct 16, 2020 5:30 pm
No new posts Copying data from prev record using SORT bshkris SYNCSORT 19 Thu Oct 15, 2020 3:29 pm
No new posts how to get total count from numeric d... Suehowe SYNCSORT 9 Fri Oct 09, 2020 8:34 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us