View previous topic :: View next topic
|
Author |
Message |
srajanbose
New User
Joined: 11 Oct 2004 Posts: 69 Location: chennai
|
|
|
|
Hi,
I have a file which have timestamp values present in columns 30-47 and 48-65 in YYYY/MM/DDHR.SEC.MIN.
Please find below the example records.
3----+----4----+----5----+----6----+
Top of Data ***********************
2010/08/2305.15.002010.08.2321.31.00
2010/08/2405.15.002010.08.2421.31.00
2010/08/2505.15.002010.08.2521.31.00
i want to split in to two based on the timestamp which in 30-47 greater than timestamp in 48-65 in one output file and the other in to another file.
Regards,
Rajan BOSE. |
|
Back to top |
|
|
nareshdacha
New User
Joined: 12 Jan 2010 Posts: 66 Location: US
|
|
|
|
Try this....
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INPUT,DISP=SHR
//SORTOF01 DD DSN=INPUT.X1,DISP=(,CATLG),
// SPACE=(CYL,(5,5))
//SORTOF02 DD DSN=INPUT.X2,DISP=(,CATLG),
// SPACE=(CYL,(5,5))
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FILES=01,
INCLUDE=(30,17,ZD,GT,48,17,ZD)
OUTFIL FILES=02,
SAVE |
30 is start position
17 is length
48 is start position
17 is length
GT = Greater than |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rajan,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/65)
//OUT1 DD DSN=... output file1 (FB/65)
//OUT2 DD DSN=... output file2 (FB/65)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(30,17,UFF,GT,48,17,UFF)
OUTFIL FNAMES=OUT2,SAVE
/*
|
Naresh,
ZD is NOT the appropriate format for values that have slashes and dots as those are NOT valid ZD characters. UFF is the correct format. |
|
Back to top |
|
|
nareshdacha
New User
Joined: 12 Jan 2010 Posts: 66 Location: US
|
|
|
|
Thanks for the correction Frank........ |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
CH is equivalent to BI as long as options like LOCALE and CHALT are not in effect. ZD is not as efficient as BI or CH. UFF is not as efficient as ZD |
Frank,
I saw your above post in another topic. Can we give 'CH' here instead of 'UFF' for the timestamp field? |
|
Back to top |
|
|
srajanbose
New User
Joined: 11 Oct 2004 Posts: 69 Location: chennai
|
|
|
|
Hi Frank,
It worked fine for me.Thanks a Lot. Could you please explain me the 'UFF' in sortcard. Its the syntax used only for Timestamp comparison?
Regards,
Rajan BOSE |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can we give 'CH' here instead of 'UFF' for the timestamp field? |
No, because one date field has / separators and the other has . separators so they aren't equivalent CH values. UFF extracts just the digits so the different separators won't matter. |
|
Back to top |
|
|
|