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 

Insert special character in first & last line

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


Joined: 09 Dec 2005
Posts: 5
Topics: 2

PostPosted: Wed Dec 21, 2005 11:05 am    Post subject: Insert special character in first & last line Reply with quote

Hi,
I have a file. I need to insert a special character X'25' at various positions only in the first & last line. My file length is 3650.
My file looks like this
HEADER: Current Date Time
ABCD1234534534DFDF
3523534657TRNGOS08
RTHROEGNSNGSFGSFG
TRAILER: COUNT RECORDS.

I want a file with special character X'25' in locations 100, 140, 200, 210, 407, 968 only for the "HEADER" & "TRAILER" records. Rest of the records should not be modified. I am trying to do this using SYNCSORT. Could someone please help.
Thanks
Sub1
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Dec 21, 2005 2:21 pm    Post subject: Reply with quote

Sub1,

Try the following untested Sysin cards.

Code:

//SYSIN    DD *     
  SORT FIELDS=COPY                                       
  OUTREC FIELDS=(0001,0099,                             
                 100:1,7,CHANGE=(1,C'HEADER:',X'25',     
                                   C'TRAILER',X'25'),   
                                 NOMATCH=(100,1),       
                 0101,0039,                             
                 140:1,7,CHANGE=(1,C'HEADER:',X'25',     
                                   C'TRAILER',X'25'),   
                                 NOMATCH=(140,1),       
                 0141,0059,                             
                 200:1,7,CHANGE=(1,C'HEADER:',X'25',     
                                   C'TRAILER',X'25'),   
                                 NOMATCH=(200,1),       
                 0201,0009,                             
                 210:1,7,CHANGE=(1,C'HEADER:',X'25',     
                                   C'TRAILER',X'25'),   
                                 NOMATCH=(210,1),       
                 0211,0196,                             
                 407:1,7,CHANGE=(1,C'HEADER:',X'25', 
                                   C'TRAILER',X'25'),
                                 NOMATCH=(407,1),     
                 0408,0560,                           
                 968:1,7,CHANGE=(1,C'HEADER:',X'25', 
                                   C'TRAILER',X'25'),
                                 NOMATCH=(968,1),     
                 0969,2592)                           
/*                                                   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Dec 22, 2005 7:46 am    Post subject: Reply with quote

If your file is not too big, and if your header and trailer are always in the first and last record, you can try the following REXX:
Code:
/* REXX */                                           
                                                     
ADDRESS TSO "EXECIO * DISKR INFILE (STEM IN. FINIS" 
                                                     
IN.1 = OVERLAY('25'X,IN.1,100)                       
IN.1 = OVERLAY('25'X,IN.1,140)                       
IN.1 = OVERLAY('25'X,IN.1,200)                       
IN.1 = OVERLAY('25'X,IN.1,210)                       
IN.1 = OVERLAY('25'X,IN.1,407)                       
IN.1 = OVERLAY('25'X,IN.1,968)                       
                                                     
IN.0 = OVERLAY('25'X,IN.0,100)                       
IN.0 = OVERLAY('25'X,IN.0,140)                       
IN.0 = OVERLAY('25'X,IN.0,200)                       
IN.0 = OVERLAY('25'X,IN.0,210)                       
IN.0 = OVERLAY('25'X,IN.0,407)                       
IN.0 = OVERLAY('25'X,IN.0,968)                       
                                                     
ADDRESS TSO "EXECIO * DISKW OUTFILE (STEM IN. FINIS"
                                                     
EXIT                                                 
                                                     

O.
________
buy grinders


Last edited by ofer71 on Sat Feb 05, 2011 11:24 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
sub1
Beginner


Joined: 09 Dec 2005
Posts: 5
Topics: 2

PostPosted: Tue Dec 27, 2005 4:14 pm    Post subject: Reply with quote

Thanks Kolusu & ofer71. Since my file is too big i am using kolusu's solution.
Back to top
View user's profile Send private message
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