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
 

 

Check if header date is eq current date (MM/DD/YYYY)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Tue Jun 18, 2013 8:28 pm    Post subject: Check if header date is eq current date (MM/DD/YYYY)
Reply with quote

Hi,

I have a requirement to check if the header date is equivalent to current date. if it is not the rest of the processing should be skipped. The header date format is MM/DD/YYYY. I tried to use the format MD4/ in INCLUDE COND, but it did not work.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Jun 18, 2013 8:35 pm    Post subject:
Reply with quote

How did it not work?
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Tue Jun 18, 2013 8:46 pm    Post subject: Reply to: Check if header date is eq current date (MM/DD/YYY
Reply with quote

There is an error in the syntax. I think i have wrongly used the MD4 condition in the INCLUDE COND. PLease find below the code and error.

Code:

   SORT FIELDS=COPY                     
   INCLUDE COND=(1,10,CH,EQ,DT=(MD4/)) 


Code:

SYSIN :                                             
  SORT FIELDS=COPY                                   
  INCLUDE COND=(1,10,CH,EQ,DT=(MD4/))               
                           *                         
WER268A  INCLUDE STATEMENT : SYNTAX ERROR           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 18, 2013 8:47 pm    Post subject:
Reply with quote

Please paste your code and input and also let us know your sort product
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 18, 2013 8:54 pm    Post subject:
Reply with quote

1.DT should be DATE
2.Please check if SYNCSORT supports DATE=(MD4/)
3.Syncosrt queries should be asked in JCL forum
4.Even if syncsort support ,to make it work you first need to overlay then try to filter that using include
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Tue Jun 18, 2013 9:05 pm    Post subject: Reply to: Check if header date is eq current date (MM/DD/YYY
Reply with quote

The product is

SYNCSORT FOR Z/OS 1.3.2.1R

jcl is

Code:
                 
//*                                                         
//SORT     EXEC PGM=SORT                                   
//SORTIN   DD DISP=SHR,DSN=TSTH.AAAAAA.REXX.INPUT           
//SYSOUT   DD SYSOUT=*                                     
//SORTOUT  DD DSN=TSTH.DFSORT.OUTP,                         
//             DISP=(NEW,CATLG),                           
//             UNIT=SYSDA,                                 
//             SPACE=(CYL,(400,400),RLSE)                   
//SYSIN DD *                                               
  SORT FIELDS=COPY                                         
  INCLUDE COND=(1,10,CH,EQ,DATE=(MD4/))                     
/*                                                         


Input is
05/31/2013
05/31/2013,BBBB,1,0.000000000,
05/31/2013,CCCC,3,0.000000000,
05/31/2013,DDDD,1,0.000000000,
05/31/2013,AAAA,4,0.000000000,
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 18, 2013 9:16 pm    Post subject:
Reply with quote

and the expected output is?
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Tue Jun 18, 2013 9:18 pm    Post subject: Reply to: Check if header date is eq current date (MM/DD/YYY
Reply with quote

i expect the header record to be copied to the output file if the current date is equal to header date (MM/DD/YYYY)
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 18, 2013 9:22 pm    Post subject:
Reply with quote

You expect to copy only the header record or even the detail records when the header record date is equal to current date?
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Tue Jun 18, 2013 9:28 pm    Post subject: Reply to: Check if header date is eq current date (MM/DD/YYY
Reply with quote

Just the header
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 18, 2013 9:49 pm    Post subject:
Reply with quote

Quote:
4.Even if syncsort support ,to make it work you first need to overlay then try to filter that using include
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Jun 19, 2013 12:57 pm    Post subject: Reply to: Check if header date is eq current date (MM/DD/YYY
Reply with quote

Hi Rajendran,

Try this code...

Assuming LRECL=80 and RECFM=FB.

Code:

//STEP1    EXEC  PGM=SORT                                         
//SORTIN   DD  *                                                 
06/19/2013                                                       
06/19/2013,BBBB,1,0.000000000,                                   
06/19/2013,CCCC,3,0.000000000,                                   
06/19/2013,DDDD,1,0.000000000,                                   
06/19/2013,AAAA,4,0.000000000                                     
//SORTOUT  DD  SYSOUT=*                                           
//SYSPRINT DD  SYSOUT=*                                           
//SYSOUT   DD  SYSOUT=*                                           
//SYSIN     DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,4,ZD)),             
        IFTHEN=(WHEN=(81,04,ZD,EQ,+1),OVERLAY=(51:7,4,1,2,4,2))   
  SORT FIELDS=COPY                                               
  OUTFIL OUTREC=(1,10,72X),INCLUDE=(51,08,CH,EQ,&DATE1)           


Output -

Code:

06/19/2013


Thanks
-3nadh
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jun 19, 2013 4:42 pm    Post subject:
Reply with quote

srajendran2,

Since you just need to validate just the first record alone, you may skip the rest of the records and check the first record as below.
Code:
//SYSIN    DD  *                                     
 OPTION COPY,STOPAFT=1                               
 INREC OVERLAY=(81:1,2,4,2,9,2)                     
 OUTFIL INCLUDE=(81,6,Y2W,EQ,Y'DATE1'),BUILD=(1,80) 
/*     
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jun 20, 2013 5:42 am    Post subject:
Reply with quote

Hi,

you may also want to set a different return code if there are no matches

Code:
//FILEOUT  DD SYSOUT=*                                         
//SYSIN    DD  *                                               
  OPTION COPY,STOPAFT=1                                         
  INREC OVERLAY=(81:1,2,4,2,9,2)                               
  OUTFIL FNAMES=FILEOUT,INCLUDE=(81,6,Y2W,EQ,Y'DATE1'),         
         BUILD=(1,80),NULLOFL=RC4                               



Gerry
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


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