creation of a easytrive key field



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

creation of a easytrive key field

Postby rakesh086 » Thu Feb 02, 2012 10:50 am

Hi,

I have my layout like

01 cust-record x(100) A
03 cust-name x(19) A
03 cust-addr x(30) A

Now i want to change this layout as

cust-record w 100 A
cust-name cust-record 1 19 A
cust-addr cust-record 20 50 A

i tried with JCL and RExx but i am not able to insert Cust-record in this conversion. Please help me from this. is there any JCL or REXX program which makes it possible.
rakesh086
 
Posts: 13
Joined: Fri Jan 06, 2012 9:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: creation of a easytrive key field

Postby BillyBoyo » Thu Feb 02, 2012 12:35 pm

Sorry, you'll have to be more clear about what you want to do. Are you converting data, or having trouble with the definition, or what?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: creation of a easytrive key field

Postby NicC » Thu Feb 02, 2012 1:43 pm

And whatever it is JCL will not do it - it is not a programming language.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: creation of a easytrive key field

Postby rakesh086 » Thu Feb 02, 2012 2:42 pm

Hi Billy/NicC,

I am going to use my cobol record layout in easytrive.

and for that i need to convert layout in easytrive.
As i know in easytrive when we are going to define a key syntax is.
cust-Key w 100 A
cust-name cust-Key 1 19 A
cust-addr cust-Key 20 50 A

and in cobol layout is
01 cust-Key x(100) A
03 cust-name x(19) A
03 cust-addr x(30) A
--------
i am using REXX code to convert this cobol layout but the output is
cust-Key w 100 A
cust-name 1 19 A
cust-addr 20 50 A

not like this(which i want)
cust-Key w 100 A
cust-name cust-Key 1 19 A
cust-addr cust-Key 20 50 A

i think we can do it by rexx or cobol also. but not getting how.

hope now you get my point.
rakesh086
 
Posts: 13
Joined: Fri Jan 06, 2012 9:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: creation of a easytrive key field

Postby BillyBoyo » Thu Feb 02, 2012 3:08 pm

You Cobol definitions are not valid. You show a "group" 01-level with a PICture. That'll get the compiler complaining. I don't know why/how your 30-byte field turns into 50 bytes, and I have no idea why you want it to.

CA provide (actually it's been around even before CA owned the product) a program to convert Cobol layouts to Easytrieve. I've not used it myself, so I don't know if it gives you the layout you want (which I think is the right way to go).

I suspect errors in your rexx, but it might help if you start off with valid Cobol.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: creation of a easytrive key field

Postby rakesh086 » Thu Feb 02, 2012 3:26 pm

extremlly sorry . thats all what u point out, my typo mistakes.
rakesh086
 
Posts: 13
Joined: Fri Jan 06, 2012 9:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: creation of a easytrive key field

Postby BillyBoyo » Thu Feb 02, 2012 3:32 pm

How would I know they are typos?

The best thing to do to post things here is to copy/paste from your mainframe screen. Then you don't get the typos (although at times I suppose pastos might be introduced).

If you can do that and explain what problem you are having, we can start to get somewhere. If you are generating the Easytrieve from rexx, are you asking how you should define fields to satisfy your requirement, or are you getting the "wrong" field definitions out of your rexx? In the latter case, it'll be a code problem in your rexx.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: creation of a easytrive key field

Postby rakesh086 » Thu Feb 02, 2012 3:58 pm

Hi Billy,

My cobol layout code

01  FILE-RECORD.                   
    03  FILE-KEY.                   
        05  FILE-ACCT.         
            07  FILE-ORG    PIC 999.
            07  FILE-ACCT   PIC X(19).


when i am converting through Rexx. i am getting

FILE-ORG                                1    3    N
FILE-ACCT                                 4    19    A


my expected output:-
FILE-RECORD                                          W       11562 A
FILE-KEY                          FILE-RECORD                22    A 
FILE-ORG                          FILE-RECORD                3     N
FILE-ACCT                         FILE-RECORD        +3      19    A
rakesh086
 
Posts: 13
Joined: Fri Jan 06, 2012 9:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: creation of a easytrive key field

Postby NicC » Thu Feb 02, 2012 4:15 pm

I would say that your Rexx program is wrong - either it is parsing your input incorrectly or you are building the output incorrectly but without seeing the code who can tell? Suggest you post your code in the rexx section of the forum - with code tags.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: creation of a easytrive key field

Postby BillyBoyo » Thu Feb 02, 2012 4:39 pm

Well done with the Code tags. You can use the Preview button to see how it looks before submitting, for those last adjustments.

You do still have a problem with a duplication in the Cobol layout.

Is the rexx code yours? Or whose?

The output from the rexx is valid Easytrieve definitions for a file, but the rexx has only chosen to do it for "elementary" items, ie ignoring group items.

You want to include group items, and you also want to be able to use the layout in the "working storage", ie with it not having to be subordinate to a file. This is also possible, but requires the rexx to be changed.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post