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

Want to split input file into 2 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Wed Sep 03, 2008 5:10 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 03, 2008 8:57 pm
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 Developer


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

PostPosted: Wed Sep 03, 2008 8:58 pm
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:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top