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
 

 

Get the system date and write in a member

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Get the system date and write in a member
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: 500
Location: USA

PostPosted: Wed Jan 21, 2009 3:31 am    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Jan 21, 2009 3:32 am    Post subject: Reply to: Get the system date and write in a member
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    Post subject:
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

Site Director


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

PostPosted: Wed Jan 21, 2009 9:56 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Get the system date and write in a member
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jan 28, 2009 4:44 pm    Post subject:
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 Moderator


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

PostPosted: Wed Jan 28, 2009 10:15 pm    Post subject:
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    Post subject: Reply to: Get the system date and write in a member
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

Site Director


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

PostPosted: Thu Jan 29, 2009 11:19 am    Post subject:
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    Post subject: Reply to: Get the system date and write in a member
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: 2165
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:17 pm    Post subject:
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

Senior Member


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

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

Hi,

You might like to check this link http://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: 2165
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:41 pm    Post subject:
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    Post subject: Reply to: Get the system date and write in a member
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    Post subject:
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

Senior Member


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

PostPosted: Thu Jan 29, 2009 4:52 pm    Post subject:
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    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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
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


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