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
 
Syncsort: Splitting file based of date

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

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Feb 15, 2012 5:22 pm    Post subject: Syncsort: Splitting file based of date
Reply with quote

Hi,
I have two files.
File1- FB,LREC=10, have only one record which have date mentioned in it.
File2- FB,Lrec=80, contains many records. Each record have date starting from 11th position and have same format as of date in first file.

Now I wanted to split file2 into sortout1 and sortout2 based on date in first file. If a date of record from file2 is greater than date in first file then that record should go in SORTOut1 file and if date of record (of file2) is equal of less than date of file 1 then records should go in sortout2 file.

How can we do this?
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Feb 15, 2012 6:25 pm    Post subject:
Reply with quote

Shriram Jogdand,
What is the format of the date in both the files?

Thanks,
Back to top
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Feb 15, 2012 6:46 pm    Post subject: Reply to: Splitting file based of date
Reply with quote

Its YYYYMMDD
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Feb 15, 2012 6:55 pm    Post subject: Reply to: Splitting file based of date
Reply with quote

You can have a look at this. Generates a DFSORT Symbol for the SYMNAMES file in the following step. Then use OUTFIL INCLUDE/OMIT for your two output files using the Symbol generated.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Feb 15, 2012 8:56 pm    Post subject:
Reply with quote

Shriram Jogdand,
See if below works...

Code:
//STEP0001 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD INPUT FB/10                                         
//SORTOUT  DD DSN=&&DT,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS) 
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  OUTFIL BUILD=(C'DT,',1,10,80:X)                                 
/*                                                               
//STEP0002 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SYMNAMES DD DSN=&&DT,DISP=(OLD,PASS)                           
//SORTIN   DD INPUT FB/80                                         
//OUT01    DD OUTPUT1 FB/80                                       
//OUT02    DD OUTPUT2 FB/80                                       
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  OUTFIL FNAMES=OUT01,INCLUDE=(11,8,ZD,GT,DT)                     
  OUTFIL FNAMES=OUT02,SAVE                     
/*                                                               

Thanks,
Back to top
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Feb 15, 2012 9:00 pm    Post subject: Reply to: Splitting file based of date
Reply with quote

Hi,
I tried below code just to create one file using SYMNAMES but it is giving SYMNAMES error

//STEP10 EXEC PGM=SORT
//SORTIN DD DSN=ABC.XYZ,
// DISP=SHR
//SORTOUT DD DSN=&&SYS1,DISP=(,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1,4,C'-',5,2,C'-',7,2)
SORT FIELDS=COPY
OUTREC BUILD=(C'CIPE,',1,10,80:X)
//*
//STEP20 EXEC PGM=SORT
//SYMNAMES DD DSN=&&SYS1,DISP=(OLD,PASS)
//SORTIN DD DSN=ABC.INPUT.FILE,
// DISP=SHR
//SORTOUT DD DSN=ABC.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(51,10,CH,EQ,CIPE)

The error coming is
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 5F782, MODEL 2817 609
*** ERRORS IN SYMNAMES STATEMENTS ***
CIPE,2012-01-31
*
*** SYNTAX ERROR ***
WER470A SYMNAMES ERRORS FOUND WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Feb 15, 2012 9:02 pm    Post subject:
Reply with quote

oohhhh golly!

seems as if SYNCSORT is not the same as DFSORT.

oh well, yet again another thread which is a waste of time
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Feb 15, 2012 9:31 pm    Post subject:
Reply with quote

Shriram Jogdand,
You didn't mention that you wanted to compare date(s) in YYYY-MM-DD format. Change your OUTREC for STEP10 as below and see if it works.

UNTESTED
Code:
OUTFIL BUILD=(C'CIPE,C''',01,10,C'''',80:X)


Thanks,
Back to top
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Thu Feb 16, 2012 2:46 pm    Post subject: Reply to: Syncsort: Splitting file based of date
Reply with quote

Thanks. It worked perfectly.
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 editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts How do you create Eclipse based dialogs jasorn IBM Tools 0 Thu Aug 03, 2017 5:05 pm


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