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
 

 

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: 2238
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: 6966
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am


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