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
 
Splitting the files in a single step

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

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Aug 17, 2008 6:56 pm    Post subject: Splitting the files in a single step
Reply with quote

Hi,

I have two files, both have different data, and have header and trailer...
I want create file 3, file 4, file 5 and file 6 using these file1 and file2 in a single step like below.

File 3 - should contain all the data(including header) of the file 1 except trailer record.

File 4 - Should contain only the trailer record(last record) of the file 1.

File 5 - Should contain only the data of the file 2(excluding header and trailer), i.e removal of header and trailer (skipping first and last record).

File 6 - Should contain only the trailer record of the file 2. i.e Last record of the file 2.

Please let me know how to get this done in a single step.

Regards,
Sasikumar
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Sun Aug 17, 2008 8:03 pm    Post subject:
Reply with quote

Sasikumar,

Is there any way to identify the header/trailer/data in both the files?
Posting a few sample input/output records would help.

Thanks,
Arun
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Aug 17, 2008 9:00 pm    Post subject:
Reply with quote

Hi Arun,

Yes at position 8 a keyword is there with lenghth 8.. so starts at 8 and ends at 15. say Eg: AAAAAAAA.

But still i wanted to know how to skip first and last recod.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Mon Aug 18, 2008 1:49 pm    Post subject:
Reply with quote

Sasikumar,

Quote:
Yes at position 8 a keyword is there with lenghth 8.. so starts at 8 and ends at 15. say Eg: AAAAAAAA


It is difficult to guess what it identifies - header or trailer or the data.

Thanks,
Arun
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Aug 18, 2008 2:14 pm    Post subject:
Reply with quote

sounds like a homework problem.
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 Aug 18, 2008 10:06 pm    Post subject:
Reply with quote

Sasikumar,

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this quite easily with the new SUBSET function of DFSORT's ICETOOL using a DFSORT/ICETOOL job like the following. If you don't have this PTF, ask your System Programmer to install it.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILE1 DD *
F1HDR
F1 DATA1
F1 DATA2
F1 DATA3
F1TRL
//FILE2 DD *
F2HDR
F2 DATA1
F2 DATA2
F2TRL
//FILE3 DD SYSOUT=*
//FILE4 DD SYSOUT=*
//FILE5 DD SYSOUT=*
//FILE6 DD SYSOUT=*
//TOOLIN DD *
* FILE3 -> FILE1 HEADER AND DATA
* FILE4 -> FILE1 TRAILER
SUBSET FROM(FILE1) TO(FILE3) DISCARD(FILE4) -
  INPUT REMOVE TRAILER
* FILE5 -> FILE2 DATA
* FILE6 -> FILE2 TRAILER (OUTFIL REMOVES FILE2 HEADER)
SUBSET FROM(FILE2) TO(FILE5) DISCARD(FILE6) -
  INPUT REMOVE HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
* NO CHANGE TO FILE5
  OUTFIL FNAMES=FILE5
* REMOVE FILE2 HEADER FROM FILE6
  OUTFIL FNAMES=FILE6,STARTREC=2
/*


For my input example, the output files would be as follows:

FILE3

Code:

F1HDR   
F1 DATA1
F1 DATA2
F1 DATA3


FILE4

Code:

F1TRL 


FILE5

Code:

F2 DATA1   
F2 DATA2   


FILE6

Code:

F2TRL


For complete details on the new SUBSET 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 Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

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