how to split files which has header and trailor

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
sowjanya
Member
Posts: 7
Joined: Tue Nov 11, 2008 10:47 am

how to split files which has header and trailor

Post by sowjanya » Tue Nov 11, 2008 10:56 am

I want to split a file contaning 188451 records along with header and trailor into 2 files where in two files should be exactly has half of records with header and trailor. I tried using the SPLIT function in SYNCSORT but am getting error.

SORT FIELDS=COPY,SKIPREC = 1,STOPAFT = 94225
*
OUTFIL FILES=01,INCLUDE=(1,25,CH,EQ,C'0') AND (1,25,CH,EQ,C'9')
SKIPREC = 94226,STOPAFT = 94225
*
OUTFIL FILES=02,INCLUDE=(1,25,CH,EQ,C'0') AND (1,25,CH,EQ,C'9')
SORT STATEMENT : SYNTAX ERROR
NO KEYWORDS FOUND ON CONTROL STATEMENT
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Can any1 say me what would be the reason??
Last edited by sowjanya on Tue Nov 11, 2008 11:19 am, edited 1 time in total.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

sort using STARTREC ENDREC

Post by Natarajan » Tue Nov 11, 2008 2:19 pm

Here is example, which may help you.

Code: Select all

//SORTOF01  DD  DUMMY                   
//SORTOF02  DD  DUMMY                   
//SYSOUT    DD  SYSOUT=*                
//SYSIN     DD  *                       
   SORT FIELDS=COPY                     
   OUTFIL FILES=01,STARTREC=1,ENDREC=2  
   OUTFIL FILES=02,STARTREC=3           
/*                                      

above sort card will copy first two records into SORTOF01 DD
rest of the record will go into SORTOF02 DD

if you dont understand, please let me know.
Natarajan
Chennai

sowjanya
Member
Posts: 7
Joined: Tue Nov 11, 2008 10:47 am

giving an error

Post by sowjanya » Wed Nov 12, 2008 8:44 am

Its giving an error at startrec

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Wed Nov 12, 2008 1:56 pm

this example was tested one. which tool you are using. Is it SORT/ICETOOL?
Natarajan
Chennai

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Nov 13, 2008 12:27 pm

It look like you have created a topic instead of replying to this topic. with subject/message with 'SORT' word. please delete that topic.


I think frank can answer your question. it might be the issue with the version
that you are using. same code worked for me.


Frank - Can you provide your valuable comments here.
Natarajan
Chennai

sowjanya
Member
Posts: 7
Joined: Tue Nov 11, 2008 10:47 am

another logic required

Post by sowjanya » Thu Nov 13, 2008 5:26 pm

thanks
Last edited by sowjanya on Mon Nov 17, 2008 3:49 pm, edited 1 time in total.

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Thu Nov 13, 2008 7:57 pm

sowjanya,

As per the mainframeGurukul's forum rules, you should not give links to our competitor websites. If you have any questions ask here.

I have updated your post.. to delete that link.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Nov 13, 2008 9:46 pm

I think frank can answer your question. it might be the issue with the version
that you are using. same code worked for me.

Frank - Can you provide your valuable comments here.
No. The original poster specifically mentioned Syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

sowjanya
Member
Posts: 7
Joined: Tue Nov 11, 2008 10:47 am

If not SyncSort DFSORT is also fine..

Post by sowjanya » Fri Nov 14, 2008 8:18 am

Hi frank,
I need other logic for the one posted..it may also be using DFSORT also is fine.

Thanks,
sowjanya

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Nov 14, 2008 9:18 pm

Sowjanya,

The messages in your first post indicate you're using Syncsort. Are you saying you have DFSORT too? If so, please run the job in your first post with DFSORT and post the messages.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Fri Nov 14, 2008 11:18 pm

Sowjanya,

I have posted a sample code for splitting the files using DFSORT in DFSORT , ICETOOL & Utilities forum. If you can use DFSORT it may help you.

http://www.mainframegurukul.com/Mainfra ... php?t=3602

Frank -> I have also asked a question, if you can have a look when you get a chance i really apprecaite it.

Thanks,
Veera.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others