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
 

 

SPLIT PS file into multiple output files based on month

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

New User


Joined: 24 Aug 2007
Posts: 4
Location: bangalore

PostPosted: Fri Aug 24, 2007 9:43 am    Post subject: SPLIT PS file into multiple output files based on month
Reply with quote

Please let me know how to split a file using SORT into Multiple files based on key field.

In this case the key field is Month. For ex
01 XXX
02 YYY
03 ZZZ
04 AAA

This has to split into 4 files. The next month the key fields change to
02 XXX
03 YYY
04 ZZZ
05 AAA

So the Key field values are dynamic but it would contain only 4 values
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Aug 24, 2007 10:26 am    Post subject:
Reply with quote

ranganathan,

Your requirement is not clear. Provide more info with examples.
Back to top
View user's profile Send private message
ranganathanv

New User


Joined: 24 Aug 2007
Posts: 4
Location: bangalore

PostPosted: Fri Aug 24, 2007 10:32 am    Post subject: Reply to: SPLIT PS FILE INTO MULTIPLE OUTPUT FILES BASED ON
Reply with quote

THE PARENT FILE CONTAINS FOLLOWING RECORDS FOR THIS MONTH

06 XXX
07 YYY
08 NNN
09 MMM

WHERE 06, 07 , 08, 09 ARE THE KEYS
OUTPUT FILES SHOULD CONTAIN

FILE 1:
06 XXX
FILE 2
07 YYY
FILE 3:
08 NNN
FILE 4:
08 MMM

THE NEXT MONTH DATE IN PARENT FILE CHANGES TO

07 YYY
08 NNN
09 MMM
10 PPP

OUTPUT FILES SHOULD CONTAIN

FILE 1:
07 YYY
FILE 2
08 NNN
FILE 3:
09 MMM
FILE 4:
10 PPP
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Aug 24, 2007 11:19 am    Post subject:
Reply with quote

ranganathan,

Does your IP file contain only MONTH part? If not, what is the date format (like ddmmyy/mmddyyyy etc...).

Also post your file attribs.
Back to top
View user's profile Send private message
ranganathanv

New User


Joined: 24 Aug 2007
Posts: 4
Location: bangalore

PostPosted: Fri Aug 24, 2007 11:32 am    Post subject:
Reply with quote

The IP file contains only the Month part. Ex: 06

File attributes

RECFM=FB
LRECL=1768
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: Fri Aug 24, 2007 8:27 pm    Post subject:
Reply with quote

Quote:
Please let me know how to split a file using SORT into Multiple files
... the Key field values are dynamic but it would contain only 4 values


Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (4 records)
//OUT1 DD DSN=...  output file (first record)
//OUT2 DD DSN=...  output file (second record)
//OUT3 DD DSN=...  output file (third record)
//OUT4 DD DSN=...  output file (fourth record)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4),SPLIT
/*
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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