Windows 플랫폼에서 실행되는 COBOL 코드를 통해 프로세스 ID 또는 상위 프로세스 ID를 얻는 방법은 무엇입니까? 마이크로 포커스 COBOL 가정Windows 플랫폼에서 COBOL의 getpid
답변
이전에 OpenCOBOL 인 GNU Cobol에 대한 답변입니다.
주식 라이브러리의 일환으로 CALL "C $ GETPID"의 반품 정수 값 END-CALL
있습니다. 기본적으로는()
당신은 표준 C 라이브러리에 연결 만의 Kernel32.dll에 액세스 할 수없는 경우가의 WinAPI를이 GetCurrentProcessId있다() (GETPID) 또는 _getpid
kerner32.dll을 내 프로젝트 (visual cobol-visual studio)에 포함 시켰습니다. 다음 명령은 Process ID, ProcessId pic s9 (9) comp-5를 제공하는 "GetCurrentProcessId"호출 프로세스 ID를 가져 왔습니다. – user1085296
, 구글이 마이크로 포커스 COBOL의 사용자로서 당신에게 http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/6539.obtaining-the-process-id-for-cobol-application.aspx
을 얻을 것이다, 당신은 지원 로그를-에 얻을 수 있습니다 및/지역 사회를 문의하십시오.
링크는 표준 C 함수 getpid에 대한 간단한 CALL을 제안합니다.
Obtaining the process ID for COBOL application
This article explains how to capture the process ID for the currently running COBOL application.
Problem:
How can the process ID (PID) within a running COBOL program be captured?
Resolution:
To capture the process ID for a currently running COBOL application, you can code a COBOL CALL statement to use the system function getpid(). The standard C libraries contain the function getpid(), which can easily be called/used from within a COBOL program.
Sample COBOL code fragments
Sample program fragment
Include the ctypes copy file from within the COBOL product directory as the first line in the COBOL program.
copy '$COBDIR/demo/c-cobol/ctypes.cpy'
WORKING-STORAGE SECTION
DATA DIVISION
Define the data item where the process id should be returned
01 current-pid long
PROCEDURE DIVISION
Call 'getpid' returning current-pid
The returned integer can be used as a part of temporary filenames, or to identify log file entries etc.
Old KB# 14408
답장을 보내 주셔서 감사합니다 ... Windows 플랫폼에서이 COBOL prog를 실행하면 의심의 여지가 없습니다. – user1085296
링크에는 Net Express/Server Express가 표시됩니다. 좀 더 구체적인 Windows 환경이 있다면, 내 대답은 Micro Focus에 등록하고 세부 사항에 대한 정확하고 신속한 지원을 얻는 것입니다. MicroFocus에 태그를 추가 했으므로 내가 가지고 있다고 가정합니다. C와의 인터페이스는 COBOL에서 매우 간단합니다. 대부분 Micro Focus 예제와 같이 작동합니다. –
- 1. Windows Mobile 플랫폼에서 PInvoke
- 2. COBOL의 CALL "SYSTEM"반환 값
- 3. COBOL의 날짜 기능
- 4. Windows 플랫폼에서 Node.js의 DB2를 연결하십시오.
- 5. Windows 이외의 플랫폼에서 sqlsrv_connect 사용
- 6. Windows 플랫폼에서 Ghostscript를 pypdfocr에 연결
- 7. Windows 플랫폼에서 작성된 LP를 Linux 플랫폼에서 실행할 수 있습니까?
- 8. 전체 프로그램에 대한 getpid(), getppid()?
- 9. COBOL의 비트 단위 논리 연산자?
- 10. COBOL의 파일에서 부동 소수점 수 읽기
- 11. Windows 7의 Haskell 플랫폼에서 Curl 사용
- 12. Windows 플랫폼에서 iOS 응용 프로그램을 개발하려면 어떻게해야합니까?
- 13. Windows 플랫폼에서 mysql_connect (localhost/127.0.0.1)이 느림
- 14. Windows 플랫폼에서 C++ 신호를 사용하는 방법
- 15. Windows 플랫폼에서 alfresco의 하드웨어 요구 사항은 무엇입니까?
- 16. mingw- windows 플랫폼에서 pjsip 라이브러리 컴파일
- 17. Windows 플랫폼에서 Android 용 libVLC 사용
- 18. Windows 플랫폼에서 android에 티타늄 모듈을 설치하는 방법
- 19. Windows 플랫폼에서 시스템 특정 값 검색
- 20. 누군가 Windows 플랫폼에서 magento를위한 redis 서버를 구성합니까?
- 21. Windows Azure 플랫폼에서 wcf 서비스 호스팅
- 22. Windows 7 플랫폼에서 node-gyp을 작동시키는 방법
- 23. Windows 플랫폼에서 TTS 대 FreeTTS의 성능은 어떻습니까?
- 24. ios 플랫폼에서 Windows 7을 사용하여 개발 시작하기
- 25. (비 Windows) 플랫폼에서 pthreads 지원이 부족합니다.
- 26. Windows 플랫폼에서 python conf 파일의 암호를 암호화합니다.
- 27. Windows 플랫폼에서 objective-c 코드 빌드
- 28. Windows 플랫폼에서 SANE 백엔드를 사용할 수 있습니까?
- 29. windows/arm 플랫폼에서 CPU 주파수 측정
- 30. Windows 플랫폼에서 PostgreSQL C 확장 기능 만들기
http://msdn.microsoft.com 호출 /en-us/library/windows/desktop/ms683215(v=vs.85).aspx와 부모 프로세스 ID에 대해서는 일반적으로이를 인수로 전달하는 것이 가장 좋으며 프로세스를 열거하고 PID를 찾고 부모 PID를 확인해야합니다 부모 프로세스가 닫히지 않고 PID가 다시 사용되기를 바랍니다. –