Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Hostname/COBOL/hostname.cobol
Normal file
15
Task/Hostname/COBOL/hostname.cobol
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
identification division.
|
||||
program-id. hostname.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
01 hostname pic x(256).
|
||||
01 nullpos pic 999 value 1.
|
||||
|
||||
procedure division.
|
||||
call "gethostname" using hostname by value length of hostname
|
||||
string hostname delimited by low-value into hostname
|
||||
with pointer nullpos
|
||||
display "Host: " hostname(1 : nullpos - 1)
|
||||
goback.
|
||||
end program hostname.
|
||||
Loading…
Add table
Add a link
Reference in a new issue