|
Hi Rishi,
Thanks for the kind and prompt reply. I've written the code as u've
said.
PGM
DCL VAR(&DAT1) TYPE(*CHAR) LEN(10)
DCL VAR(&DAT2) TYPE(*CHAR) LEN(6)
RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DAT2)
CVTDAT DATE(&DAT2) TOVAR(&DAT1) TOFMT(*ISO) TOSEP(-)
CALL PGM(DATRPG1) PARM(&DAT1)
ENDPGM
But for storing the date into PF you need RPG isn't it?
My RPG code is as follows ---:
FDATE1 O E DISK
C *ENTRY PLIST
C PARM DAT1 10
C WRITEDATREC
C SETON LR
Even then the RUNQRY result was as follows ---:
Line ....+....1
DAT1
000001 0001-01-01
****** ******** End of report ********
Rajeev Asthana suggested to use TIME opcode. I used that also.
Srinivas.
***********************************************************************
Hi Rajeev,
My RPG Code is as follows ---:
FDATE1 O E DISK
C TIME TIM1 120
C MOVE TIM1 TIMC 12
C 6 SUBSTTIMC:7 DAT2 6
C CALL 'DATCL'
C PARM DAT2
C PARM DAT1 10
C WRITEDATREC
C SETON LR
************** End of data **************************
My CLP is ---:
PGM PARM(&DAT2 &DAT1)
DCL VAR(&DAT1) TYPE(*CHAR) LEN(10)
DCL VAR(&DAT2) TYPE(*CHAR) LEN(6)
CVTDAT DATE(&DAT2) TOVAR(&DAT1) TOFMT(*ISO) TOSEP(-)
RETURN
***** End of data **************************************
Even then the RUNQRY result is --
Line ....+....1
DAT1
000001 0001-01-01
000002 0001-01-01
****** ******** End of report ********
AS I told I've declared DAT1 in PF as L data type. My problem is I am
not able to write the date data into my PF. Kindly advise.
Thanks.
Srinivas.
************************************************************************
Hi Jon,
Thanks for the advice. Till now I haven't shifted to RPG IV. Once I
learn that I'll do that.
Thanks a lot once again.
Srinivas.
************************************************************************
---rishi pherwani <rishirp@yahoo.com> wrote:
>
>
>
>
> hi Srinivas,
> Rishi here
> i have got the solution and my program is running fine.
> i am working on V4R2.
> keep the length of the field as 6 char.
> heres my program
> PGM
> DCL VAR(&DATE1) TYPE(*CHAR) LEN(6)
> RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE1)
> SNDPGMMSG MSG(&DATE1) TOPGMQ(*EXT)
> ENDPGM
>
> bye
> rishi
> ---"G.R.Srinivas" wrote:
> >
> > Hello Everyone,
> >
> > Can anyone help me in retrieving system date either in CLP or in RPG
> > and storing it in the PF. I am working on V4R3. I've tried the
> > following method but it didn't work.
> >
> > PF Member --:
> > R DATREC
> > DAT1 L
> >
> > DSPF Member --:
> > A 5 21'DATE : '
> > A DAT1 R L I 5 31REFFLD(DATREC/DAT1
TLIB1/DATE1)
> >
> > RPG Member --:
> > FDATE1 O E DISK
> > FA CF E WORKSTN
> > C EXFMTDA
> > C WRITEDATREC
> > C SETON LR
> >
> > Input --:
> >
> > DATE : 1999-01-01
> >
> >
> > PF output --:
> > Display Report
> >
> > Report width . . . .
. :
> > 10
> > Position to line . . . . . Shift to column . . . .
. .
> >
> > Line ....+....1
> >
> > DAT1
> >
> > 000001 0001-01-01
> >
> > 000002 0001-01-01
> >
> > ****** ******** End of report ********
> >
> >
>
> > The CLP code is
> > PGM
> > DCLF A
> > DCL VAR(&DAT1) TYPE(*CHAR) LEN(26)
> > RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DAT1)
> > SNDRCVF RCDFMT(DA)
> >
> > ENDPGM
> >
> > There was no compilation error but hte runtime error was
> > CPF1095 received by DATCL at 400.
> > whatever length I give I get this message.
> >
> > If anyone could help me, I would be very much obliged.
> > THANKS A LOT in advance.
> >
> > Srinivas.
> >
> >
> > _________________________________________________________
> > DO YOU YAHOO!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> * * *
> > * This is the RPG/400 Discussion Mailing List! To submit a new
> *
> > * message, send your mail to "RPG400-L@midrange.com". To
> unsubscribe *
> > * from this list send email to MAJORDOMO@midrange.com and specify
> *
> > * 'unsubscribe RPG400-L' in the body of your message. Questions
> should *
> > * be directed to the list owner / operator: david@midrange.com
> *
> > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> * * *
> >
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * *
> * This is the RPG/400 Discussion Mailing List! To submit a new
*
> * message, send your mail to "RPG400-L@midrange.com". To
unsubscribe *
> * from this list send email to MAJORDOMO@midrange.com and specify
*
> * 'unsubscribe RPG400-L' in the body of your message. Questions
should *
> * be directed to the list owner / operator: david@midrange.com
*
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * *
>
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List! To submit a new *
* message, send your mail to "RPG400-L@midrange.com". To unsubscribe *
* from this list send email to MAJORDOMO@midrange.com and specify *
* 'unsubscribe RPG400-L' in the body of your message. Questions should *
* be directed to the list owner / operator: david@midrange.com *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.