MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Excluding particular records using DFSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Srishti Rawat
Beginner


Joined: 03 Nov 2021
Posts: 20
Topics: 6

PostPosted: Tue Nov 16, 2021 12:23 am    Post subject: Excluding particular records using DFSORT Reply with quote

Hi Team,

I have an input file having records as below. I need to exclude a particular string of length 5 starting from position 5 and ending at position 10 in each row without touching the trailer record. Also need to delete the header from the file.

Input:
Header
12345678910119999
12345678910190900
Trailer record

Expected output:
12340119999
12340190900
Trailer record

Could anyone please suggest how to achieve this using DFSORT.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Nov 16, 2021 4:13 am    Post subject: Reply with quote

Srishti Rawat,

Assuming your input has RECFM=FB and LRECl=80, use the following untested JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *
Header
12345678910119999
12345678910190900
Trailer
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *             
  OPTION COPY,SKIPREC=1
  INREC IFTHEN=(WHEN=(1,7,CH,NE,C'Trailer'),
         BUILD=(1,4,11,70,6X))
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group