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 3 bytes in a sequential file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Thu Mar 13, 2008 2:36 am    Post subject: Insert 3 bytes in a sequential file Reply with quote

I want to include records which is present in 9th position(length is of 2 bytes) and then insert 3 bytes in the ouput file starting from the 1st position and then followed by the data that is present in the input file

For Example:If the data in the 9th position is 'XX' then insert '001' in the 1st position of the output file followed by the remaining datas of the input file OR if the data in the 9th position is 'YY' then insert '002' in the 1st position of the output file followed by the remaining datas of the input file OR if the data in the 9th position is 'ZZ' then insert '002' in the 1st position of the output file followed by the remaining datas of the input file.

Can this be achieved using INCLUDE and OUTREC, If so can someone give the syntax?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Mar 13, 2008 4:47 am    Post subject: Reply with quote

JCL does not have INCLUDE or OUTREC statements. You should have posted in the Utilities section where questions relating to a sort utlity should reside. Now that it IS here, though, do NOT repost. People will find it whislt looking at JCL problems.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Mar 13, 2008 10:54 am    Post subject: Reply with quote

sankar narayanan,

try the following control cards. I assumed that your input is FB recfm and is of 80 bytes in length

Code:

//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(3X,1,80)),   
         IFTHEN=(WHEN=(12,2,CH,EQ,C'XX'),     
        OVERLAY=(1:C'001')),                   
         IFTHEN=(WHEN=(12,2,SS,EQ,C'YY,ZZ'),   
        OVERLAY=(1:C'002'))                   
//*                                           

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


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Mar 14, 2008 4:52 am    Post subject: Reply with quote

Woops! Just remembered - JCL DOES have an INCLUDE statement! I've been writing JCL for 35 years and I forgot about that - but I never use INCLUDE for real partly because the Powers That Be don't like 'new-fangled' things and partly because I like to see everything in one place.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
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 -> Job Control Language(JCL) 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