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
 

 

convert number of days to date format.

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

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jul 12, 2012 12:48 pm    Post subject: convert number of days to date format.
Reply with quote

hi,
is there any way i can convert number of days to date through jcl?
i need the date in ISO FORMAT.i searched the forum but did not help

Regds,
useit
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jul 12, 2012 12:53 pm    Post subject:
Reply with quote

Hello,
Sounds like a Julian date to X date format conversion.
Show us the input and output records. Someone will be able to help.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jul 12, 2012 2:10 pm    Post subject:
Reply with quote

from HF to ISO format.

for example input is +11881

after converting it should be 2012-07-12

Regds,
useit
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 12, 2012 3:01 pm    Post subject:
Reply with quote

What release of DFSort are you at? Not sure? Look here: How to determine your DFSORT function level.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jul 12, 2012 3:14 pm    Post subject:
Reply with quote

hi we have ICE201I H record type

Regds,
useit
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Jul 12, 2012 3:38 pm    Post subject:
Reply with quote

useit wrote:
from HF to ISO format.

for example input is +11881

after converting it should be 2012-07-12

Regds,
useit

This suggests that you're getting data from a toy computer with an epoch of 1 January 1980?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jul 12, 2012 3:43 pm    Post subject:
Reply with quote

Hello try this,
Code:
//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
11881                                                   
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  INREC IFOUTLEN=80,                                   
  IFTHEN=(WHEN=INIT,OVERLAY=(81:C'01011980')),         
  IFTHEN=(WHEN=INIT,OVERLAY=(01:81,8,Y4W,ADDDAYS,1,5,ZD,
  TOGREG=Y4T(-)))                                       
//*                                                     


Output:
Code:
2012-07-12


I dont know what HF format is. -11881 pointed to Jan 1 1980. So assumed that dates begin from Jan 1 1980
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Thu Jul 12, 2012 4:20 pm    Post subject:
Reply with quote

vasanth,
correct the date begins from 1 January 1980.how did you say that 11881 is pointing at jan 1 1980?

thanx for your solution.i got confused with the input date format.

Regds,
useit
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jul 12, 2012 4:31 pm    Post subject:
Reply with quote

Hello,
This SAS program told that -11881 was 01 Jan 1980.
Code:
data _null_;         
now = today() - 11881;
put now ddmmyy10.;   
run;                 


output: 01/01/1980
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jul 13, 2012 5:34 am    Post subject: Reply to: convert number of days to date format.
Reply with quote

I can't test it at the moment, but you could perhaps try defining a SYMNAME for the literal, rather than adding the literal to the end of the record.

Might not make much nevermind with one record, but as a bonus it removes the need to know where to extend the data with VB vs FB. Can have a nice descriptive name as well. OLDTOYCOMPUTERSTARTDATE or something even better...
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 convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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