Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. tstprg: proc options(main);
  2.  
  3. dcl inFile file record input;
  4. dcl eof_infile bit(1) init('0'b);
  5. on endfile(inFile) eof_infile = '1'b;
  6.  
  7. dcl inTable(10) char(32);
  8. dcl inTableSize bin fixed(31,0) init(0);
  9.  
  10. dcl targTable(5) char(32);
  11.  
  12. call mainprog;
  13.  
  14. mainprog: proc reorder;
  15. open file(inFile);
  16.  
  17. inTableSize += 1;
  18. read file(inFile) into(inTable(inTableSize));
  19.  
  20. do until(eof_infile);
  21. inTableSize += 1;
  22. read file(inFile) into(inTable(inTableSize));
  23. end;
  24.  
  25. close file(inFile);
  26. inTableSize -= 1;
  27.  
  28. call proc1;
  29. end mainprog;
  30.  
  31. proc1: proc reorder;
  32. call proc2;
  33. end proc1;
  34.  
  35. proc2: proc reorder;
  36. dcl i bin fixed(31,0);
  37.  
  38. do i = 1 to inTableSize;
  39. someTable(i) = inTable(i);
  40. end;
  41. end proc2;
  42.  
  43. end tstprg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement