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
 

 

Date format in trailer1

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

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Fri Aug 28, 2009 4:34 pm    Post subject: Date format in trailer1
Reply with quote

How can I subtract the one day from current date in TRAILER1. If I use DATE1-1 it is not working in TRAILER1. Please find my code below,

OUTFIL REMOVECC,NODETAIL,
TRAILER1=(DATE1-1,C',MD,',TOT=(1,1,ZD,TO=ZD,LENGTH=8)

I am able to get current using DATENS=(4MD). Can anyone help how to substract one day from current date.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Aug 28, 2009 9:57 pm    Post subject:
Reply with quote

Senthilkumar k,

You cannot use a relative date on trailer/header parms. You can use the relative date on INREC/OUTREC. use the following DFSORT JCL.

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                     
1                                                   
2                                                   
3                                                   
4                                                   
5                                                   
6                                                   
7                                                   
8                                                   
9                                                   
0                                                   
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                 
  INREC BUILD=(1,1,DATE1-1,12X)                     
  OUTFIL REMOVECC,NODETAIL,                         
  TRAILER1=(2,8,C',MD,',TOT=(1,1,ZD,TO=ZD,LENGTH=8))
/*


This will create a 21 byte FB file like this
Code:

20090827,MD,00000045


If you want a 80 byte output file then change the inrec to the following

Code:

INREC BUILD=(1,1,DATE1-1,80:X)
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1475
Location: Chennai

PostPosted: Tue Sep 08, 2009 12:55 am    Post subject:
Reply with quote

Hi,

I have the same requirement but I am unable to use the BUILD statement as suggested above to get the relative date, since a BUILD is already used in the below code,

Code:
  OPTION COPY                                                           
  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND,                                 
                124,2,SS,EQ,C'01,02,03,04,05,06,11,14,99',AND,         
                1,8,CH,EQ,DATE1-1)                                     
  INREC IFOUTLEN=100,                                                   
 IFTHEN=(WHEN=(124,2,CH,EQ,C'01'),BUILD=(DATE1-1,9:C'100000000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'02'),BUILD=(DATE1-1,9:C'010000000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'03'),BUILD=(DATE1-1,9:C'001000000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'04'),BUILD=(DATE1-1,9:C'000100000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'05'),BUILD=(DATE1-1,9:C'000010000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'06'),BUILD=(DATE1-1,9:C'000001000')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'11'),BUILD=(DATE1-1,9:C'000000100')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'14'),BUILD=(DATE1-1,9:C'000000010')),     
 IFTHEN=(WHEN=(124,2,CH,EQ,C'99'),BUILD=(DATE1-1,9:C'000000001'))       
  OUTFIL REMOVECC,NODETAIL,                                             
    TRAILER1=(MIN=(1,8,ZD),C',MD,',TOT=(9,1,ZD,TO=ZD,LENGTH=8),         
                              C',',TOT=(10,1,ZD,TO=ZD,LENGTH=8),       
                              C',',TOT=(11,1,ZD,TO=ZD,LENGTH=8),       
                              C',',TOT=(12,1,ZD,TO=ZD,LENGTH=8),       
                              C',',TOT=(13,1,ZD,TO=ZD,LENGTH=8),       
                              C',',TOT=(14,1,ZD,TO=ZD,LENGTH=8),
                              C',',TOT=(15,1,ZD,TO=ZD,LENGTH=8),
                              C',',TOT=(16,1,ZD,TO=ZD,LENGTH=8),
                              C',',TOT=(17,1,ZD,TO=ZD,LENGTH=8))
/*



The input file has date in YYYYMMDD format from 1-8 positions.
The aim is to count the number of occurences of individual records at
124,2,CH and add previous day's date and produce a CSV report like below,
Code:

20090906 ,MD,00000061,00000000,00000137,00000013,00000000,00000000
,00000000,00002472,00000008


The code works ok, but when there are no records that meet the include condition criteria, the report is something like,

Code:

0,MD,00000000,00000000,00000000,00000000,00000000,00000000
,00000000,00000000,00000000
sterb050.gif

The need is to have the relative date intact even if the records that meet the include condition are 0.

Could you please suggest a fix for this or an another solution.

Pls let me know if you need more information.

Thanks & Regards,
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 How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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