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 

How to merge a file and constant value in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
pkarthik@email.com
Beginner


Joined: 29 Mar 2005
Posts: 34
Topics: 18
Location: Canada

PostPosted: Tue Aug 23, 2005 5:56 am    Post subject: How to merge a file and constant value in JCL Reply with quote

Hi ,

I need a flat file of 40 character.

I have a VSAM file 1223 characters .I am planning to get 20 characters from Vsam to which I need to add a default constant of 20 characters long and Make it as 40 Characters. How could I be able to add 20 character constant to each 20 length record .This 40 character flat file should be prepared using the JCL. Later this flat file need to be loaded to the DB2 Table.



Could any one please help me.
In deriving the file and utiliy to upload flat file to DB2 Table.


Regards

Karthik.P
_________________
For any type of complex problems there will be multiple easiest solutions
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 23, 2005 6:04 am    Post subject: Reply with quote

Karthik,

This is the simplest exercise. If you looked at SORT or JCL forum you would have found several examples of stripping the data and adding constants to the output file.

Quote:

This 40 character flat file should be prepared using the JCL


I wonder as to why you opened this topic in Application programming. Please post your questions to the right forum.

ex:

Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=YOUR VSAM FILE,
//            DISP=SHR           
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTREC FIELDS=(10,20,   $ COPY 20 BYTES FROM POS 15 OF INPUT
                 C'MY 20 BYTE CONSTANT')
/*                                     


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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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