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 

Include user defined HEADER for extracted records from input

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


Joined: 21 Dec 2007
Posts: 23
Topics: 12

PostPosted: Fri Oct 17, 2008 6:28 am    Post subject: Include user defined HEADER for extracted records from input Reply with quote

Hi,

I have a input file having the record length of 250.
I would like to extract the records into output file if the input records having 'BANK' in the position 1 to 4.

My output would look like
Code:

EMPNAME EMPID DESIGNATION
AAA 253 Software engineer
BBB 789 Accountant
CCC 689 Quality lead

Header name (EMPNAME EMPID DESIGNATION) of the output is user defined.
Code:

AAA -->is in the input file position 100 to 103
253 -->is in the input file position 150 to 153
Software engineer --> in the input file position 200 to 225

I am trying with SORT and INCLUDE Statements as below.
Code:

//S2 EXEC PGM=SORT,
//SORTIN DD DISP=SHR,DSN=INPUT FILE
//SORTOUT DD DSN=OUTPUT FILE
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(100,3,CH,A)
OUTFIL HEADER1=(1:'EMPNAME',3X,
2:'EMPID',3X
3:'DESIGNATION',3X),REMOVECC,
OUTREC=(1:100,3,10X,2:150,3,8X,3:200,25,8X)
INCLUDE COND=(1,4,CH,EQ,C'BANK')
/*


But I am getting the following abend.

'OUTREC HAS OVERLAPPING FIELDS SPECIFIED'

Please suggest me how could I get this done using JCL

Thanks,
Naveen.
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: Fri Oct 17, 2008 10:23 am    Post subject: Reply with quote

me_naveen,

Use the following Control cards

Code:

//SYSIN    DD *   
  INCLUDE COND=(1,4,CH,EQ,C'BANK')   
  SORT FIELDS=(100,3,CH,A)                         
  OUTREC BUILD=(01:100,3,                           
                11:150,3,                         
                19:200,25)                         
  OUTFIL REMOVECC,                                 
  HEADER1=(1:'EMPNAME',3X,'EMPID',3X,'DESIGNATION')
/*


Hope this helps..

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


Joined: 21 Dec 2007
Posts: 23
Topics: 12

PostPosted: Sat Oct 18, 2008 2:57 am    Post subject: Reply with quote

Hi Kolusu,

Thank you very much.Its working fine now.

Thanks,
Naveen.
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