Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need logic to write to other file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
satyapn9

New User


Joined: 08 Oct 2010
Posts: 27
Location: India

PostPosted: Tue Oct 12, 2010 8:07 pm    Post subject: Need logic to write to other file
Reply with quote

Hello,

I have an input file of length 80 and has 50 records in it. I would like to write an output file of length 160 and it should contain the records like below:

<------80----> <----80---->
______________________
1 |--------------|----------------| 26
2 |--------------|----------------| 27
3 |--------------|----------------| 28
4 |--------------|----------------| 29
.. |--------------|----------------| ..
.. |--------------|----------------| ..
.. |--------------|----------------| ..
25|________|__________| 50

as in the picture..... first 25 records should be written to first half and second 25 should be written to second half of the output file.

can you please guide me how to code this icon_question.gif


Thank you,

Regards,
Satya Prasad Nimmakayala.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Oct 12, 2010 9:53 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. Note that the input file is used for //IN1 and //IN2.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file
//IN2 DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(81,2,A),SORTED,NOSEQCK
  JOINKEYS F2=IN2,FIELDS=(81,2,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:1,80,F2:1,80)
  OPTION COPY
/*
//JNF1CNTL DD *
  OPTION STOPAFT=25
  INREC OVERLAY=(81:SEQNUM,2,ZD)
/*
//JNF2CNTL DD *
  OPTION SKIPREC=25
  INREC OVERLAY=(81:SEQNUM,2,ZD)
/*
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us