Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy sent of records and Writing to different files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy sent of records and Writing to different files
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: 6968
Location: porcelain throne

PostPosted: Mon Oct 12, 2009 7:28 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Oct 12, 2009 7:37 pm    Post subject:
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    Post subject: Reply to: Copy set of records and Writing to different files
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: 8593
Location: Back in jolly old England

PostPosted: Mon Oct 12, 2009 7:46 pm    Post subject:
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    Post subject: Reply to: Copy sent of records and Writing to different file
Reply with quote

hello,

We have both DFSORT & SYNCSORT
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: Mon Oct 12, 2009 9:12 pm    Post subject:
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    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 Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 6 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us