Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

write records based on the input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 2:43 pm    Post subject: write records based on the input file
Reply with quote

I have a file like below :_

Code:
I - EN123456
I - EN789101
D - EN12345678912
D - EN1436578



All records starting with "I" should be written into O/P file A. Like below :-
Code:
I - EN123456
I - EN789101

All records starting with "D" should be written into O/P file B like below :-
Code:
D - EN12345678912
D - EN1436578
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Jan 31, 2007 2:54 pm    Post subject:
Reply with quote

Hi There,

You can use sort for this

Code:

...
//SORTOFA DD DSN=...  output file1
//SORTOFD DD DSN=...  output file2
//SYSIN DD *
  OPTION COPY             
  OUTFIL FILES=A,INCLUDE=(1,1,CH,EQ,C'I')       
  OUTFIL FILES=B,INCLUDE=(1,1,CH,EQ,C'D')


Hope it will helpful
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 2:58 pm    Post subject:
Reply with quote

do i put the above in sysin ? where do i code the above ?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Jan 31, 2007 3:02 pm    Post subject:
Reply with quote

Hi Murli,

Yes u have to put them in sysin

Code:
//STEP001  EXEC PGM=SORT                 
//SYSIN    DD *                           
  OPTION COPY             
  OUTFIL FILES=A,INCLUDE=(1,1,CH,EQ,C'I')       
  OUTFIL FILES=B,INCLUDE=(1,1,CH,EQ,C'D')
/*
//SORTIN   DD DSN=TBH2.XOI.FORMAT.DATA,DISP=SHR             
//SORTOFA  DD output filea               
//SORTOFB  DD output fileb
//SYSOUT   DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*


Hope it is clear now
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 3:39 pm    Post subject: Re: write records based on the input file
Reply with quote

PV9793a.keep is the input file. Its contents are :-

ID SOURCE LINES

Code:
I - BP/MR10FYI/0806MR10FYI2006080B         
I - BP/MR10FYI/0806MR10FYI2006080C         
D - BP/MR10FYI/0806MR10FYI2006080A         


Code:

//STEP1   EXEC PGM=SORT                                       
//SORTIN  DD DSN=PV9793A.KEEP,DISP=(MOD,KEEP)                 
//SORTOFA DD DSN=PV9793A.OUTPUT.FILEA,                       
//           DISP=SHR                                         
//SORTOFB DD DSN=PV9793A.OUTPUT.FILEB,                       
//           DISP=SHR                                         
//SYSOUT  DD SYSOUT=*                                         
//SYSIN   DD *                                               
  OPTION COPY                                                 
  OUTFIL FILES=A,INCLUDE=(1,1,CH,EQ,C'I')                             
  OUTFIL FILES=B,INCLUDE=(1,1,CH,EQ,C'D')       
//*SORT FIELDS=(1,2,CH,A)               
//*  INCLUDE COND=(6,2,CH,EQ,C'EN')     
//*OUTREC FIELDS=(6,75)                 
/*                                     
//   
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 3:40 pm    Post subject:
Reply with quote

the above does not give me any o/p even if there needs to be something in the o/p file.
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 4:08 pm    Post subject: Re: write records based on the input file
Reply with quote

though everything is correct, there is nothing in the o/p files. This means the sort due to some reason is not picking up the records needed.

Request some one to help....
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Jan 31, 2007 4:28 pm    Post subject:
Reply with quote

Hi murali922,

R u sure that i/p file is fixed length file what is the DCB of i/p file?
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 4:38 pm    Post subject: Re: write records based on the input file
Reply with quote

hi,

there was a problem with the position i gave... it works fine now ! icon_smile.gif

thanks.... icon_biggrin.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Jan 31, 2007 5:23 pm    Post subject: Re: write records based on the input file
Reply with quote

murali922 wrote:
there was a problem with the position i gave... it works fine now ! icon_smile.gif
was it "INCLUDE=(2,1,"?
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Wed Jan 31, 2007 8:01 pm    Post subject:
Reply with quote

yes. it was 2,1 icon_biggrin.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Jan 31, 2007 8:10 pm    Post subject:
Reply with quote

Dang I'm good...... icon_biggrin.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jan 31, 2007 9:53 pm    Post subject:
Reply with quote

Murali,

Since you're doing a COPY you don't need the SORTWKdd DD statements - they just waste space unless you're doing a SORT and even then it's better not to specify the SORTWKdd DD statements so sort can dynamically allocate the work data sets.

You also don't need the OUTREC=(1,80) operands unless you want to reformat the records.

I've cleaned up all the jobs above.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us