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
 

 

Sort card to copy the particular field from I/p to O/P file

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Jan 04, 2008 7:02 pm    Post subject: Sort card to copy the particular field from I/p to O/P file
Reply with quote

Dear Expert,

My requirement is as below:

The length of the input file is 80 bytes and I want to copy a particular field from position 17 to 20 which is in Binary format to the first four bytes of the output file in the same Binary format.

And I want to keep all the remaining 76 bytes as spaces.

Can you provide me the SORT card for this.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jan 04, 2008 7:42 pm    Post subject:
Reply with quote

Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=I/P FILE FB/80                         
//SORTOUT  DD DSN=O/P FILE FB/80                         
//SYSIN    DD *                                         
           SORT FIELDS=COPY                             
  OUTREC OVERLAY=(17,4,80:X)                             
/*                                                       
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: Fri Jan 04, 2008 10:25 pm    Post subject:
Reply with quote

Krisprems,

That won't work. 80:X in OVERLAY will just put a blank in position 80 - it will not put blanks in positions 5-80 as you seem to be assuming (overlay only changes the positions you tell it to change). 17-20 will have the original value instead of blanks.

The correct DFSORT job is:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file (FB/80)
//SORTOUT  DD DSN=...  output file (FB/80)
//SYSIN    DD *
  OPTION COPY
  OUTREC BUILD=(1:17,4,80:X)
/*


80:X in BUILD will put blanks in positions 5-80.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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