Portal | Manuals | 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: 39
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: 778
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: 39
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

Senior Member


Joined: 21 Sep 2010
Posts: 2387
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 How to remove remote file older than ... ssuthagar All Other Mainframe Topics 4 Thu Jun 04, 2020 6:26 am
No new posts How to fetch the latest record from a... Dinesh Mani DFSORT/ICETOOL 8 Tue Jun 02, 2020 5:34 pm
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am
No new posts COBOL Student learning COBOL File Han... torrind COBOL Programming 3 Sat May 09, 2020 3:40 am
No new posts Position BSAM file on multi volume lbjerges PL/I & Assembler 3 Thu May 07, 2020 8:13 pm

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