Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passing parameters in Enform.

190 views
Skip to first unread message

Vijay Muralidharan

unread,
May 23, 2013, 12:46:42 PM5/23/13
to
I need to pass the input that i got from the user to enform query. "A" is the variable tht contains user input. Is it possible to use "A" in WHERE CLAUSE as i written? If not, tell me some alternatives.




?TACL MACRO
#FRAME
#PUSH A
#INPUTV A "PLEASE ENTER THE CARD NO : "

#set #inlineprefix ++

ENFORM /inline/
++ ?ASSIGN TLF TO $AXIS03.AXISATLF.TL130508
++ ?DICTIONARY $AXIS03.AT60DDL

++ ?OUT $AXIS03.VJAY.tlfdb
++ OPEN TLF;
++ LIST BY RESP-CDE HEADING "RESPONSE CODE",
++ TO-ACCT.ACCT-NUM HEADING "TO ACCOUNT",
++ FROM-ACCT.ACCT-NUM HEADING "FROM ACCOUNT",
++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ A,
++ CENTER ALL;
++ CLOSE TLF
++ EXIT
#UNFRAME

Robert Hutchings

unread,
May 23, 2013, 1:37:34 PM5/23/13
to
Hi Vijay,

This probably won't work as written. I don't think ENFORM will understand the "WHERE CRD.PAN EQ A" snippet. In TACL you typically enclose A as [A] to access the value of A, sort of like de-referencing a pointer...

I will check the ENFORM manual.

Robert Hutchings

unread,
May 23, 2013, 1:57:15 PM5/23/13
to
OK, here is one idea...my changes are --->...

?TACL MACRO
#FRAME
#PUSH A
#INPUTV A "PLEASE ENTER THE CARD NO : "

#set #inlineprefix ++

ENFORM /inline/
++ ?ASSIGN TLF TO $AXIS03.AXISATLF.TL130508
++ ?DICTIONARY $AXIS03.AT60DDL

++ ?OUT $AXIS03.VJAY.tlfdb
++ OPEN TLF;
----> ++ DECLARE user-var;
----> ++ SET user-var TO 10
++ LIST BY RESP-CDE HEADING "RESPONSE CODE",
++ TO-ACCT.ACCT-NUM HEADING "TO ACCOUNT",
++ FROM-ACCT.ACCT-NUM HEADING "FROM ACCOUNT",
++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ user_var,

Robert Hutchings

unread,
May 23, 2013, 2:09:03 PM5/23/13
to
You may have to do this...

ENFORM/in enfile/

where "enfile" contains ENFORM commands. You would need to write a TACL MACRO to edit/change the contents of "enfile" based on user input.

Doug Miller

unread,
May 23, 2013, 2:36:32 PM5/23/13
to
Vijay Muralidharan <vijay....@gmail.com> wrote in news:d7aeacc6-bdfa-4e2c-96da-
ad4198...@googlegroups.com:

> I need to pass the input that i got from the user to enform query. "A" is the variable tht
contains user input. Is it possible to use "A" in WHERE CLAUSE as i written? If not, tell me
some alternatives.
>
>
>
>
> ?TACL MACRO
> #FRAME
> #PUSH A
> #INPUTV A "PLEASE ENTER THE CARD NO : "
[...]

Change this
> ++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ A,
to this
> ++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ [A],

Robert Hutchings

unread,
May 23, 2013, 3:03:43 PM5/23/13
to
Here is another approach:

?TACL MACRO
#FRAME
#PUSH A
#INPUTV A "PLEASE ENTER THE CARD NO : "

edit enfile;c/==pan_var==/[A];e

ENFORM/ in enfile /

#UNFRAME


---enfile---

++ ?ASSIGN TLF TO $AXIS03.AXISATLF.TL130508
++ ?DICTIONARY $AXIS03.AT60DDL
++ ?OUT $AXIS03.VJAY.tlfdb
++ OPEN TLF;
++ LIST BY RESP-CDE HEADING "RESPONSE CODE",
++ TO-ACCT.ACCT-NUM HEADING "TO ACCOUNT",
++ FROM-ACCT.ACCT-NUM HEADING "FROM ACCOUNT",
++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ ==pan_var==,

Vijay Muralidharan

unread,
May 25, 2013, 12:18:19 AM5/25/13
to
@ Doug Miller :

I tried that already. Not working.

@Robert :
edit enfile;c/==pan_var==/[A];e

cant get this line. Can u pls explain in detail.

Robert Hutchings

unread,
May 25, 2013, 7:55:06 AM5/25/13
to
OK, sorry. I will do some research and get back with you...

Robert Hutchings

unread,
May 25, 2013, 8:21:04 AM5/25/13
to
Make sure #informat is TACL, then try this:

edit enfile;c/==pan_var==/[A]/;e - notice the use of / , it is

TACL> edit enfile; change /==pan_var==/[A]/all does this work?


Doug Miller

unread,
May 25, 2013, 10:07:03 AM5/25/13
to
Vijay Muralidharan <vijay....@gmail.com> wrote in news:879bb5f2-687a-44f7-8bf6-
6c01d3...@googlegroups.com:

> @ Doug Miller :
>
> I tried that already. Not working.

"Not working" is a rather vague description of the problem. What happens?

Copy-paste your actual code, and the results.

Keith Dick

unread,
May 25, 2013, 4:36:11 PM5/25/13
to
If CRD.PAN is character field, not a numeric field, Doug's suggestion probably needs to be changed to:

++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ "[A]",

I echo his latest comment -- just saying "it doesn't work" is not the best approach to getting help with figuring out what's wrong. If you want our help, you need to give us enough information to go on.
Message has been deleted

Vijay Muralidharan

unread,
May 26, 2013, 6:35:39 AM5/26/13
to
Ok. Let me explain very clearly. I need to get the 12 digit number from the user.. With tht no I need to generate a report using enform. Im trying to use WHERE clause with the input ( crd.pan ) what i got from the user.

Doug Miller

unread,
May 26, 2013, 10:18:01 AM5/26/13
to
Vijay Muralidharan <vijay....@gmail.com> wrote in
news:699b3d7e-dc6c-4217...@googlegroups.com:

> Ok. Let me explain very clearly. I need to get the 12 digit no
> from the user. With tht no I need to generate a report using
> enform. WHERE clause should be used with the 12 digit no tht I
> got from the user.
>

Yes, I understand that; it was obvious from the beginning. Do *you* understand that if you want
help solving this problem, you need to post your exact code, AND the exact results of running
it, before anyone can help you?

Simply saying "not working" doesn't do the job.

Keith Dick

unread,
May 26, 2013, 8:28:29 PM5/26/13
to
Vijay Muralidharan wrote:
> Ok. Let me explain very clearly. I need to get the 12 digit number from the user.. With tht no I need to generate a report using enform. Im trying to use WHERE clause with the input ( crd.pan ) what i got from the user.

What is the data type of crd.pan? Is it really numeric, or is it character? Show us the DDL that declares it if you aren't sure.

Vijay Muralidharan

unread,
May 27, 2013, 1:21:50 PM5/27/13
to
@Keith : It is character and as you said,
++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ "[A]", works fine. Now i can able to retrieve the selective fields based on the user input.

Thanks Keith.

@Doug : It's my mistake making it not very clear here. Actually when i gave

++ SEQ-NUM HEADING "SEQ NUMBER",WHERE CRD.PAN EQ [A]
i got Unknwn type A. After changing i got it right. Thank u All.
0 new messages