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
 
Want to split input file into 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Wed Sep 03, 2008 2:23 pm    Post subject: Want to split input file into 2 files
Reply with quote

Hi,

I want to split input file into 2 files using key word FA030-AB.

Input file.

AUTH RECORDS-0000
UNDEFINED BODYS-000000, REDUNDANT RECS -000000
HOT JOBS ONFILE-00000, OVER PSP CUTOFF-00000
OVER SO CUTOFF-00000, DICT RECORDS-00051
1RPT # FA030-AB BDDDHFHF -HELD VEHICLES
JOB# JDFS0209 PGM# JFS020E -002 09/02/2008 18:35 SERIES 9 OPTION
S.O. SL VON BODY ENG PNT TRN TRIM MKT *************

PMDY0624912 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624913 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624914 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624915 PMDH49 ECN PXR DAV Z5DV 171 ANDY


Output file 1:

AUTH RECORDS-0000
UNDEFINED BODYS-000000, REDUNDANT RECS -000000
HOT JOBS ONFILE-00000, OVER PSP CUTOFF-00000
OVER SO CUTOFF-00000, DICT RECORDS-00051
1RPT # FA030-AB BDDDHFHF -HELD VEHICLES

Output file 2:

JOB# JDFS0209 PGM# JFS020E -002 09/02/2008 18:35 SERIES 9 OPTION
S.O. SL VON BODY ENG PNT TRN TRIM MKT *************

PMDY0624912 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624913 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624914 PMDH49 ECN PXR DAV Z5DV 171 ANDY
PMDY0624915 PMDH49 ECN PXR DAV Z5DV 171 ANDY

I want to split these input file using only keyword FA030-AB.
Could some one help me how to split using SORT.

Thanks
ran12.
Back to top
View user's profile Send private message

guptae

Moderator


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

PostPosted: Wed Sep 03, 2008 5:10 pm    Post subject:
Reply with quote

Hello Ran2,

Please bind below jcl for this. Its not an optimal solution but it will give you desired output.

Code:
//STEP010  EXEC PGM=ICEMAN                                       
//SYSPRINT DD SYSOUT=*                                           
//SORTIN   DD *                                                 
HOT JOBS ONFILE-00000, OVER PSP CUTOFF-00000                     
OVER SO CUTOFF-00000, DICT RECORDS-00051                         
1RPT # FA030-AB BDDDHFHF -HELD VEHICLES                         
JOB# JDFS0209 PGM# JFS020E -002 09/02/2008 18:35 SERIES 9 OPTION
S.O. SL VON BODY ENG PNT TRN TRIM MKT *************             
123                                                             
/*                                                               
//CT1      DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//CT2      DD DSN=&&S2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSOUT   DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC BUILD=(1:1,80,81:SEQNUM,8,ZD)                           
* CREATE DFSORT SYMBOL AS:                                       
* TARG,+NNN                                                     
  SORT FIELDS=(81,8,ZD,A)                                       
  OUTFIL FNAMES=CT1,INCLUDE=(8,8,CH,EQ,C'FA030-AB'),             
  OUTREC=(C'TARG,+',81,8,80:X)                                   
  OUTFIL FNAMES=CT2,SAVE                                         
/*                                                               
//S2       EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                           
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                           
//SORTIN   DD *                                                 
HOT JOBS ONFILE-00000, OVER PSP CUTOFF-00000                     
OVER SO CUTOFF-00000, DICT RECORDS-00051                         
1RPT # FA030-AB BDDDHFHF -HELD VEHICLES                         
JOB# JDFS0209 PGM# JFS020E -002 09/02/2008 18:35 SERIES 9 OPTION
S.O. SL VON BODY ENG PNT TRN TRIM MKT *************             
123                                                             
/*   
//CT1      DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INREC OVERLAY=(81:SEQNUM,8,ZD)                           
  OUTFIL FNAMES=CT1,INCLUDE=(81,8,ZD,LE,TARG),OUTREC=(1,80)
/*   


Please let me know if you have any question regarding this
Back to top
View user's profile Send private message
ranjith12

New User


Joined: 02 Sep 2008
Posts: 6
Location: chenni

PostPosted: Wed Sep 03, 2008 5:38 pm    Post subject: Reply to: Want to split input file into 2 files
Reply with quote

Hi Ekta,

Thanks for quick reply .. i want to use only sort utilities ...
my input is report file in that the kayword FA030-AB is constant (for example input contain 10000 record and the key word exist in record 5500 then my 1st output should contain 5500 records and 2nd output should contain 4500 record).

Please let me know is there any command to split the file using perticular key word.

Thanks,
Ran2.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 03, 2008 8:57 pm    Post subject:
Reply with quote

Hello,

Quote:
i want to use only sort utilities ...


ICEMAN is the sort utility. . .
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 Sep 03, 2008 8:58 pm    Post subject:
Reply with quote

ran12,

If you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008), 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 you can change the job appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,END=(8,8,CH,EQ,C'FA030-AB'),
    PUSH=(81:ID=1))
  OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
  OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,80)
/*


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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