Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - Update a dataset with contents of a second dataset ?

Status
Not open for further replies.

Mvsop

Technical User
Oct 4, 2005
1
AU
I am just a newbie to the rexx language but having a lot of fun learning and this forum is very helpful with the learning curve.My question is with a rexx i am planning to write and would like to know if it would be possible.
I have one dataset (A) that has several headings in there and a second dataset (b) that is used to put special instructions in that will change frequently.Two of the headings in dataset A are called instructions and problems and i want the rexx to compare the lines between these two headings with the contents of dataset B.If they arnt the same update dataset A with the contents of dataset B between the instruction and problem heading.The rexx would then bring up the dataset in edit mode with nothing else changed in dataset A.
If the contents are the same no action is to be taken and dataset A is brought up in edit mode.

I hope this makes sense and thanks in advance for any help that can be provided.
 
In all cases, whatever is in B must appear between "Instructions" and "Problems" in A. Why not leave that part of A empty and always make the insertion regardless? That simplifies the problem immensely since you can have one dataset containing the front-part of A (thru "Instructions") and another which is the back-part of A (from "Problems"). Then it becomes:
Code:
"ALLOC FI($TMP) DA("a_front") SHR REU"
"EXECIO * DISKR $TMP (FINIS" /* load the queue */
"ALLOC FI($TMP) DA("b_instr") SHR REU"
"EXECIO * DISKR $TMP (FINIS" /* add to queue */
"ALLOC FI($TMP) DA("a_back") SHR REU"
"EXECIO * DISKR $TMP (FINIS"  /* add to queue */
"ALLOC FI($TMP) UNIT(VIO) NEW DELETE SPACE.... etc"
"EXECIO" queued() "DISKW $TMP (FINIS"  /* dump queue */
"LMINIT DATAID(NEWA) DDNAME($TMP)"
"VIEW DATAID("newa")"
"LMFREE DATAID("newa")"
"FREE  FI($TMP)"  /* ... and delete */





Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top