Skip to main content

Using the contents of a variable as a variable

  • May 25, 2012
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 25 May 2012]

Hi,

I’m trying to create a delimited text file using only selected fields from a database. The problem I have is that the fields I need to extract from the database and the fields in the file that I want to move them to can change. So for example, I may want to move DATABASE-FIELD-1 to TEMP-FIELD-1 but I don’t know that the content (or value) of DATABASE-FIELD-1 is DATE-OF-BIRTH, nor do I know that the content (or value) of TEMP-FIELD-1 is TEMP-DATE-FIELD-1.

Is there a quicker way of finding out what the fields are without using IF statements to determine what each of the fields are? In other words, can I use the contents of a variable as a variable?

Any help would be very much appreciated.

1 reply

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • May 25, 2012

[Migrated content. Thread originally posted on 25 May 2012]

Hi,

I’m trying to create a delimited text file using only selected fields from a database. The problem I have is that the fields I need to extract from the database and the fields in the file that I want to move them to can change. So for example, I may want to move DATABASE-FIELD-1 to TEMP-FIELD-1 but I don’t know that the content (or value) of DATABASE-FIELD-1 is DATE-OF-BIRTH, nor do I know that the content (or value) of TEMP-FIELD-1 is TEMP-DATE-FIELD-1.

Is there a quicker way of finding out what the fields are without using IF statements to determine what each of the fields are? In other words, can I use the contents of a variable as a variable?

Any help would be very much appreciated.
You posted your question on the Extend portion of the forum. The extend forum deals with ACUCOBOL questions and issues. I can not think of how you can do what you are trying to do without knowing what the database columns or variables should contain. I think you'd be better off posting your question on the Net Express portion of the forum.

community.microfocus.com/.../3_COBOL__Net_Express_Server_Express_Visual_COBOL