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
 
Comparision with current time

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

New User


Joined: 13 Jul 2016
Posts: 33
Location: India

PostPosted: Thu Nov 09, 2017 10:37 am    Post subject: Comparision with current time
Reply with quote

Hi All,

I have written below code to compare a field of my dataset with current time and if it is less than current time we have to OMIT it. Below code is not throwing any error but not throwing correct output as well. Can someone please look into this:-

Code:

//STEP01   EXEC PGM=SORT                     
//SYMNAMES DD *                             
    CTIME,S'&TIME2'                         
//SORTJNF1 DD DSN=GMMM.JOB.DET.FMT,         
//            DISP=SHR                       
//SORTJNF2 DD DSN=GMMM.JOB.SLA.FMT,         
//            DISP=SHR                       
//SORTOUT  DD DSN=GMMM.BATCH.JOB.OUT,       
//            DISP=(NEW,CATLG,DELETE),       
//            DATACLAS=STANDARD,             
//            DCB=(DSORG=PS,RECFM=FB)       
//SYSOUT   DD SYSOUT=*                       
//SYSIN    DD *                             
  JOINKEYS FILE=F1,FIELDS=(1,08,A)           
  JOINKEYS FILE=F2,FIELDS=(1,08,A)           
  REFORMAT FIELDS=(F1:1,08,F2:10,4,F1:10,20)
  JOIN UNPAIRED,F2                           
  SORT FIELDS=COPY                           
  OMIT COND=(9,4,CH,LT,CTIME)               
/*                   
[/code]
Back to top
View user's profile Send private message

Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Nov 09, 2017 2:26 pm    Post subject:
Reply with quote

Throwing? on z/OS?

What output do you get - any error messages? do you see the SYMNAMES resolved?

Garry.
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 33
Location: India

PostPosted: Thu Nov 09, 2017 4:57 pm    Post subject:
Reply with quote

I checked that in CDATE field &DATE2 is populated.

Its should pick current time.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1922
Location: UK

PostPosted: Thu Nov 09, 2017 5:04 pm    Post subject:
Reply with quote

Nothing is "thrown" on z/OS - ever.
What output did you get? What was your input?
Back to top
View user's profile Send private message
Smita.t2

New User


Joined: 17 Apr 2012
Posts: 26
Location: Bangalore

PostPosted: Tue Nov 14, 2017 4:18 pm    Post subject:
Reply with quote

Please try.

Code:

//STEP01   EXEC PGM=SORT                     
//SYMNAMES DD *                             
     CTIME,S'&TIME2'                         
//SORTJNF1 DD DSN=GMMM.JOB.DET.FMT,         
//            DISP=SHR                       
//SORTJNF2 DD DSN=GMMM.JOB.SLA.FMT,         
//            DISP=SHR                       
//SORTOUT  DD DSN=GMMM.BATCH.JOB.OUT,       
//            DISP=(NEW,CATLG,DELETE),       
//            DATACLAS=STANDARD,             
//            DCB=(DSORG=PS,RECFM=FB)       
//SYSOUT   DD SYSOUT=*
//JNF2CNTL DD *
  OPTION COPY
  OMIT COND=(10,4,CH,LT,CTIME) 
/*                       
//SYSIN    DD *                             
  JOINKEYS FILE=F1,FIELDS=(1,08,A)           
   JOINKEYS FILE=F2,FIELDS=(1,08,A)           
   REFORMAT FIELDS=(F1:1,08,F2:10,4,F1:10,20)
   JOIN UNPAIRED,F2                           
   SORT FIELDS=COPY                           
             
/*

Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 212
Location: Maryland

PostPosted: Tue Nov 14, 2017 8:56 pm    Post subject: Re: Comparision with current time
Reply with quote

arunsoods wrote:
I have written below code to compare a field of my dataset with current time and if it is less than current time we have to OMIT it. Below code is not throwing any error but not throwing correct output as well.

Besides of all, the explanation of your task doesn't match in any way the example of your code.

Nevertheless, whenever results are not clear, try to investigate the code step by step, starting from the most primitive version of it.
Code:
//CTIME2   EXEC PGM=SORT                                             
//*                                                                   
//SYMNAMES DD *                                                       
CTIME,S'&TIME2'                                                       
//*                                                                   
//SORTIN   DD *                                                       
00000000  1010BBBBBBCCCCCCCCCC
11111111  1011BBBBBBCCCCCCCCCC
22222222  1012BBBBBBCCCCCCCCCC
33333333  1013BBBBBBCCCCCCCCCC
44444444  1014BBBBBBCCCCCCCCCC
55555555  1015BBBBBBCCCCCCCCCC
66666666  1016BBBBBBCCCCCCCCCC
77777777  1017BBBBBBCCCCCCCCCC
88888888  1018BBBBBBCCCCCCCCCC
//*                                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OMIT COND=(10,4,CH,GT,CTIME)                                       
  SORT FIELDS=COPY                       
  OUTREC FIELDS=(1,30,X,&TIME2,X,CTIME)   
  END                                     
//*                                       


As we can find, the SORT statements do work absolutely not in that way you assumed:
Code:
SYSIN :                                       
  OMIT COND=(10,4,CH,GT,CTIME)               
  SORT FIELDS=COPY                           
  OUTREC FIELDS=(1,30,X,&TIME2,X,CTIME)       
 END                                         
DATA DICTIONARY SYMBOLS SUBSTITUTED :         
OMIT COND=(10,4,CH,GT,C'&TIME2')             
SORT FIELDS=COPY                             
OUTREC FIELDS=(1,30,X,&TIME2,X,C'&TIME2')     

And the output is not what is expected
Code:
----+----1----+----2----+----3----+----4--
00000000  1010BBBBBBCCCCCCCCCC 1016 &TIME2
11111111  1011BBBBBBCCCCCCCCCC 1016 &TIME2
22222222  1012BBBBBBCCCCCCCCCC 1016 &TIME2
33333333  1013BBBBBBCCCCCCCCCC 1016 &TIME2
44444444  1014BBBBBBCCCCCCCCCC 1016 &TIME2
55555555  1015BBBBBBCCCCCCCCCC 1016 &TIME2
66666666  1016BBBBBBCCCCCCCCCC 1016 &TIME2
77777777  1017BBBBBBCCCCCCCCCC 1016 &TIME2
88888888  1018BBBBBBCCCCCCCCCC 1016 &TIME2

I hope, this initial explanation might be enough for you to continue YOUR OWN WORK by yourself, not asking for the final ready-to-use solution?
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
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

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