IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy sent of records and Writing to different files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Oct 12, 2009 7:23 pm
Reply with quote

Dear All,
I have a requirement , there is a flat file in which I have records as given below



Code:

1FPY        01A00CP1FILE1       
2CORRECT.......                 
2ERROR.........                 
2WARNING.......                 
1FPY        01A00CP1FILE2       
2CORRECT.......                 
2ERROR.........                 
2WARNING.......                 
1FPY        01A00CP1FILE3       
2CORRECT.......                 
2ERROR.........                 
2WARNING.......                 
1FPY        01A00CP1FILE4       
2CORRECT.......                 
2ERROR.........                 
2WARNING.......                 
1FPY        01A00CP1FILE5       
2CORRECT.......                 
2ERROR.........                 
2WARNING.......                 


My reqiurement is to split these recrods as given below

Code:

1FPY        01A00CP1FILE1       
2CORRECT.......                 
2ERROR.........                 
2WARNING....... 


Code:

1FPY        01A00CP1FILE2       
2CORRECT.......                 
2ERROR.........                 
2WARNING....... 


Code:

1FPY        01A00CP1FILE3       
2CORRECT.......                 
2ERROR.........                 
2WARNING....... 


Code:

1FPY        01A00CP1FILE4       
2CORRECT.......                 
2ERROR.........                 
2WARNING....... 


1FPY 01A00CP1FILE5
2CORRECT.......
2ERROR.........
2WARNING.......
Code:


There can be maximum of 5 set of such records which are to be copied to 5 diff files. If it is only 3 set of records then it has to move to 3 different files.

Can this be done by Sort or COPY or ICETOOL, please let me know ASAP
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 12, 2009 7:28 pm
Reply with quote

Quote:
Can this be done by Sort or COPY or ICETOOL, please let me know ASAP


I hope this answer is quick enough for you----yes it can be done with DFSORT; SYNCSORT also.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Oct 12, 2009 7:37 pm
Reply with quote

Which sort product is installed at your site ? By posting in the JCL forum we can only assume that it is SYNCSORT.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Oct 12, 2009 7:43 pm
Reply with quote

could you please provide me the JCLS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Oct 12, 2009 7:46 pm
Reply with quote

The solution depends on the product that is installed at your site.

Unless you bother to tell us, how will we know.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Oct 12, 2009 7:56 pm
Reply with quote

hello,

We have both DFSORT & SYNCSORT
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Oct 12, 2009 9:12 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/80)
//OUT3 DD DSN=...  output file3 (FB/80)
//OUT4 DD DSN=...  output file4 (FB/80)
//OUT5 DD DSN=...  output file5 (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),PUSH=(81:ID=1))
  OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
  OUTFIL FNAMES=OUT2,INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(1,80)
  OUTFIL FNAMES=OUT3,INCLUDE=(81,1,CH,EQ,C'3'),BUILD=(1,80)
  OUTFIL FNAMES=OUT4,INCLUDE=(81,1,CH,EQ,C'4'),BUILD=(1,80)
  OUTFIL FNAMES=OUT5,INCLUDE=(81,1,CH,EQ,C'5'),BUILD=(1,80)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top