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
 
compare timestamp columns using dfsort

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

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Mon Aug 02, 2010 1:46 pm    Post subject: compare timestamp columns using dfsort
Reply with quote

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
View user's profile Send private message

nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Mon Aug 02, 2010 4:59 pm    Post subject: Reply to: compare timestamp columns using dfsort
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 02, 2010 11:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Tue Aug 03, 2010 8:30 am    Post subject: Reply to: compare timestamp columns using dfsort
Reply with quote

Thanks for the correction Frank........
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Aug 03, 2010 10:18 am    Post subject:
Reply with quote

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
View user's profile Send private message
srajanbose
Warnings : 1

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Tue Aug 03, 2010 4:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Aug 03, 2010 4:59 pm    Post subject:
Reply with quote

Commonly Used Data Formats
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: Tue Aug 03, 2010 11:35 pm    Post subject:
Reply with quote

Here's a more complete description of DFSORT's formats:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/C.0?DT=20090527161936
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: Tue Aug 03, 2010 11:38 pm    Post subject:
Reply with quote

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
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm

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