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
 

 

How to get current date in a header in the format yyyymmdd ?

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

New User


Joined: 09 Jul 2007
Posts: 59
Location: Chennai

PostPosted: Fri Apr 18, 2008 3:18 pm    Post subject: How to get current date in a header in the format yyyymmdd ?
Reply with quote

I need to display the current date in the header in the format yyyymmdd.

Ex: 20080418

There should be no separators between year,month & day.

Code:

SORT FIELDS=COPY                   
OUTFIL FILES=OUT,                 
HEADER1=(1:'0001',32:&DATE(4MD' '))


This displays only 2008 04 18.

I tried using
Code:

HEADER1=(1:'0001',32:&DATE(4MD''))


But it gives some syntax error.

Please do let me know how to get this output.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Apr 18, 2008 6:31 pm    Post subject: Reply to: How to get current date in a header in the format
Reply with quote

Mariraj,

Try DATENS instead of DATE

Code:
DATENS=(4MD)),
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: Fri Apr 18, 2008 11:27 pm    Post subject:
Reply with quote

Code:

&DATE(4MD' ')


This is invalid syntax - the correct syntax would be as follows (you could use the & but you don't need it):

Code:

DATE=(4MD )


You shouldn't have apostrophes around the blank separator.

If you don't want the separator, use DATENS instead of DATE:

Code:

DATENS=(4MD)
Back to top
View user's profile Send private message
Mariraj

New User


Joined: 09 Jul 2007
Posts: 59
Location: Chennai

PostPosted: Mon Apr 21, 2008 9:29 am    Post subject:
Reply with quote

Thanks to both of you.
DATENS worked fine.
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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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