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 

Creation of delimited file through JCL

 
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
anaik100
Beginner


Joined: 09 Feb 2009
Posts: 1
Topics: 1

PostPosted: Mon Feb 09, 2009 8:26 pm    Post subject: Creation of delimited file through JCL Reply with quote

Hi,


I have a requirement to create a delimited output file.

File 1: has columns
Code:

      a       b       c       d       e

in file 2 :
my data order should be
Code:

      b;      d;      c;      e;      a

I can achieve the format of File2 from file1 by using OUTREC.
But i have one more condition. I need to include the column names on the first line and then the data should be copied.
So file 2 output will be in the format
Code:

Column1;Column2;column3;column4;column5
      b;      d;      c;      e;      a
      b;      d;      c;      e;      a
      b;      d;      c;      e;      a

Please advise on how i can achieve this

Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Feb 09, 2009 9:13 pm    Post subject: Reply with quote

anaik100,

Try this. I assumed that your each field is 7 bytes in length.

Code:

//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *
----+----1----+----2----+----3----+----4----+----5
      a       b       c       d       e
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                       
  SORT FIELDS=COPY           
  OUTFIL REMOVECC,
  BUILD=(08,07,C';',
         24,07,C';',
         16,07,C';',
         32,07,C';',
         01,07,80:X),                           
  HEADER1=('COLUMN1;COLUMN2;COLUMN3;COLUMN4;COLUMN5;')
/*   

_________________
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 -> 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