Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
add 10 bytes into a record through SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
kumar119119

New User


Joined: 31 May 2010
Posts: 25
Location: Pune

PostPosted: Fri Jul 30, 2010 10:00 pm    Post subject: add 10 bytes into a record through SORT
Reply with quote

Hi to All,

This is an IBM interview question,

Interviewer:

I have 100 records in a file,
LRECL=80,

1.......9 12.....20 25......40 45........60


this is the record layout,

I want to insert ABCDEFGHIJ from 66........75 in all 100 records,

How do you code this?

Please Folks.... give me answer, I cant reply,
I tried to explain through COBOL, but he wants thru SORT only
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Jul 31, 2010 6:13 pm    Post subject:
Reply with quote

Try this untested code:
Code:
//SYSIN DD *                       
  OPTION COPY                       
  INREC FIELDS=(1,65,66:C'ABCDEFGHIJ',76:66,14)
/*

Note that this will produce an output data set with LRECL=90 rather than LRECL=80. To keep the same LRECL you would need to use OVERLAY but then what to do with those ten bytes which are OVERLAYed, should be answered first.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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