passing system date to program via proc



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

passing system date to program via proc

Postby supriya saraswat » Fri Jul 11, 2008 5:21 pm

i want to pass current date to my cobol program through jcl.how can i pass .

what will be the cobol prog and jcl for that.

can any one tell me...
supriya saraswat
 
Posts: 21
Joined: Mon Jul 07, 2008 3:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby Bill Dennis » Fri Jul 11, 2008 7:20 pm

You can use SORT program to write current date into a file and then read it into your program. Try running this:
//SORT     EXEC PGM=IERRCO00                 
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=80       
//SORTOUT  DD DISP=(,CATLG),DSN=yourid.DATECARD,       
//            UNIT=3390,SPACE=(TRK,1),VOL=SER=dasd   
//SYSIN    DD *                                       
 OPTION COPY                                           
 OUTFIL HEADER1=(DATENS=(MD4),TIME=(12.))             
//*                                                     
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby MrSpock » Fri Jul 11, 2008 7:59 pm

I'm curious to know why you'd want to pass a system date to a program when the program can just as easily retrieve the system date itself. What is the supposed advantage here?
User avatar
MrSpock
Global moderator
 
Posts: 808
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: passing system date to program via proc

Postby supriya saraswat » Mon Jul 14, 2008 11:34 am

actually i got a program in which date for certain variables are fetched externally..i was unable to understand..
thats why....
supriya saraswat
 
Posts: 21
Joined: Mon Jul 07, 2008 3:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby jayind » Fri Jul 18, 2008 1:39 pm

Hi supriya saraswat,

actually i got a program in which date for certain variables are fetched externally..


if you can post the piece of code you are having difficulty to understand and respective JCL part, people will be able to help you..

Regards,
Jayind
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby supriya saraswat » Tue Jul 22, 2008 6:30 pm

Actually in the cobol program logic that processes date as an external parameter should be replaced with a logic that uses date from a system.

the problem is not with jcl...
so plz tell me what should be the logic???
supriya saraswat
 
Posts: 21
Joined: Mon Jul 07, 2008 3:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby jayind » Wed Jul 23, 2008 4:25 pm

Hi Supriya,

Since you have gone through the program, you understood how the date is handling currently.. we dont know how the date handled now and hence cant provide a solution until we see the piece of code handling the date currently. Looks like you have concern pasting the code in the forum, probably you can mask the values and change the variable names and make it as generic.

Regards,
jayind
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time

Re: passing system date to program via proc

Postby Bill Dennis » Thu Jul 24, 2008 2:19 am

Are you changing the method simply because you don't understand the current logic?

Are you certain you always want the system date? What if you need to rerun yesterday's job?

Of course, all we can do is guess since the use of the date is not very well explained.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post