Jump to content


Photo
- - - - -

creating a temp file


6 replies to this topic

#1 Paul Taylor

Paul Taylor

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male

Posted 14 November 2016 - 03:38 PM

Can you tell me if I am able to do the following:

 

I want to create a temp .pro file based a generated file name, I have been doing some research on the &#@create command, if I create the file with this command does it require a file def to work. if so can I use a file def from a "template def"  to create some way. Would I be able to use the alias to make this work.

 

I am relatively new to proiv but have used temp files in rpg to create files on the fly found it more flexible, I am using v6 of proiv and we develop via the green screens

 

 

 



#2 Wim Soutendijk

Wim Soutendijk

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 211 posts
  • Gender:Male
  • Location:Netherlands

Posted 15 November 2016 - 08:13 AM

Hi Paul,

 

you can use a logic statement #S = SYSTEM('iscr -k10 temp.pro') for a proisam file with a key of 10 characters.

Optionally add -r followed by the record length if needed.

if you are on windows V6 uses iscr32.exe in stead of iscr.exe

 

Then you can define an ALIAS() command with your file def to temp.pro

 

wim



#3 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 16 November 2016 - 05:28 PM

Version 6 and above supports Memory files (type MKY). I would highly recommend you go with that as an implementation solution unless you need a second session to see the contents of the temporal file, as memory files are session based. And they get automatically destroyed when the session terminates - no clean up. Great joy.

Also, research CREATE_INTERNAL_FILE in the on-line help (topic id 520196), as version 6 supports this should you still need a physical file.


Things should be made as simple as possible, but not simpler

#4 Paul Taylor

Paul Taylor

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male

Posted 15 December 2016 - 01:11 PM

used a memory file worked good thanks for the info.



#5 Paul Taylor

Paul Taylor

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male

Posted 29 December 2016 - 07:15 PM

just noticed that the memory file def I crated is still creating an external file, I am using the proiv developer to create the file def. the documentation mentions to not set the external file flag but haven't been able to locate this flag. any ideas.

 

Thanks



#6 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 29 December 2016 - 07:32 PM

The external file flag is hidden when using PROIV Developer as it is determined by the file type that is selected. If the file type is MKY (and you have recompiled all the functions that reference the file) then I can guarantee that the file will not be external. Can you elaborate on what you mean by 'still creating an external file'


Things should be made as simple as possible, but not simpler

#7 Paul Taylor

Paul Taylor

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male

Posted 30 December 2016 - 01:31 PM

Sorry my mistake with the external file, I recreated some test files and when I do a ls not showing, although I implemented a function using a mky file and one of the users got a 054 error trying to access the file, could there be a restriction with the user creating the file in memory.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users