IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Get the system date and write in a member


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Wed Jan 21, 2009 12:45 am
Reply with quote

I want to read the system run date YYYYMMDD and write into a member file.

Nirmal
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Jan 21, 2009 3:31 am
Reply with quote

Nirmal,

Where are you reading the date from? Does it already exist in a file, or are you just pulling in the current system date? And where are you writing it out to... A new data set as a stand alone record or MODing on to an existing file? Is it being inserted on every record or only once as a HEADER or TRAILER?

If you would like further assistance, you need to provide more information. Please provide your complete requirements, including the RECFM and LRECL of the files, and any pertinent field positions and lengths.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 21, 2009 3:32 am
Reply with quote

I would go with either:

Code:

//SYM EXEC PGM=EZACFSM1
//SYSIN    DD  *
&YR4&LMON&LDAY
/*
//SYSOUT   DD  DISP=SHR,DSN=MY.PDS(MEMBER)


or

Code:

//SORT EXEC PGM=ICEMAN
//SORTIN    DD  *
DUMMY
/*
//SORTOUT  DD  DISP=SHR,DSN=MY.PDS(MEMBER)
//SYSOUT   DD  SYSOUT=*
//SYSIN    DD  *
  OPTION COPY
  INREC OVERLAY=(1:DATE1,80:X)
/*
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Wed Jan 21, 2009 9:26 am
Reply with quote

I want to pull the current system date in the JCL and write the same into the member having a LRECL=80 and RECFM=FB.
The date will be the only data in the member file.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 21, 2009 9:56 am
Reply with quote

Hello,

Quote:
I want to pull the current system date in the JCL and write the same into the member
That is exactly what Kevin has shown you 2 ways to do. . .

Did you run the examples posted? If not, why not? If yes, what happened?
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Wed Jan 21, 2009 12:58 pm
Reply with quote

Thanks a lot.
Back to top
View user's profile Send private message
vishnu.priya

New User


Joined: 28 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Jan 28, 2009 4:26 pm
Reply with quote

hi

after getting the system date i want to manipulate that date in the jcl
For example :
if current date is 20090128
i want to subtract 1 day from it is thr any way to do it
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jan 28, 2009 4:44 pm
Reply with quote

What have you tried so far.

What documents have you read for the two examples shown by Kevin ? I am certain that DFSORT has some great date manipulation facilities. Why not take a look ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 28, 2009 10:15 pm
Reply with quote

You can use DFSORT's DATE1-1 function to subtract 1 from the current date (yyyymmdd form).

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT   DD  SYSOUT=*
//SORTIN    DD  *
DUMMY
/*
//SORTOUT  DD  DSN=pds(member),...  FB/80 pds member
//SYSIN    DD  *
  OPTION COPY
  INREC BUILD=(DATE1-1,80:X)
/*
Back to top
View user's profile Send private message
vishnu.priya

New User


Joined: 28 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu Jan 29, 2009 11:15 am
Reply with quote

hi Frank
thanks for the quick reply
i tried doing as said by you, but got U0016 abend

Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT   DD  SYSOUT=*
//SORTIN    DD  *
DUMMY
/*
//SORTOUT  DD  DSN=XXXX.DATE.SORT.PGMS.PDS(DATE1SUB)
//SYSIN    DD  *
  OPTION COPY
  INREC BUILD=(DATE1-1,80:X)
/*


Can you please suggest on how can i proceed further
[/b]
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 29, 2009 11:19 am
Reply with quote

Hello,

You need to post the diagnostic info presented when the run terminated. Include message ids as well as message text when you post this.
Back to top
View user's profile Send private message
vishnu.priya

New User


Joined: 28 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu Jan 29, 2009 11:50 am
Reply with quote

hello dick
Code:
SYSIN :                                           
  OPTION COPY                                     
    INREC BUILD=(DATE1-1,80:X)                   
                           *                               
WER268A  INREC STATEMENT   : SYNTAX ERROR         
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE     

this is the message i got with USER=0016 Abend

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jan 29, 2009 1:17 pm
Reply with quote

vishnu.priya,

Which version of SyncSort you're running? It'll be there on the top of your SYSOUT.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jan 29, 2009 1:25 pm
Reply with quote

Hi,

You might like to check this link www.ibmmainframes.com/viewtopic.php?t=32960&highlight= but that again depends on which version of SyncSort is in use at your shop.

Just fyi..Other JCL posted by Frank does work on DFSORT site - I've just verified it with one of my friend whose shop uses DFSORT and it didn't work for you because either you dont' have the latest (1.3 or above) version of SyncSort or you don't have DFSORT (which is evident from your sysout messages).
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jan 29, 2009 1:41 pm
Reply with quote

vishnu.priya,

I tried executing your JCL and it works fine for my version which is SyncSort for z/OS Release 1.3.
Also I could see the below in my manual as pointed out by Anuj.
SyncSort for z/OS Release 1.3 Manual wrote:
• Offset date support for the current date constant has been added. The current date can be specified with an offset of an increased or decreased number of days or months.
Back to top
View user's profile Send private message
vishnu.priya

New User


Joined: 28 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Thu Jan 29, 2009 3:34 pm
Reply with quote

thanks arcvns and anuj, as said by you, ours is a older version of syncsort (SYNCSORT FOR Z/OS 1.2.2.2R version)

Thanks again for the information
Back to top
View user's profile Send private message
lohithegde

New User


Joined: 18 May 2008
Posts: 31
Location: Chennai

PostPosted: Thu Jan 29, 2009 3:56 pm
Reply with quote

Hi Visnu

The both Code Posted by SUPERK is working fine....If it is not working in your SETUP, contact your ADMIN

Thanks to superk for good Example

Rehards
Lohit
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jan 29, 2009 4:52 pm
Reply with quote

lohithegde wrote:
The both Code Posted by SUPERK is working fine....If it is not working in your SETUP, contact your ADMIN
Yes, they will work well but the Vishnu in intrested in getting one date less than the current date..with SYNCSORT FOR Z/OS 1.2.2.2R or something else.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top