Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote and Literal subcommands are implemented #34

Merged
merged 3 commits into from
Jun 1, 2024
Merged

Conversation

mslinn
Copy link
Contributor

@mslinn mslinn commented May 2, 2024

Fixes #33

@mslinn
Copy link
Contributor Author

mslinn commented May 3, 2024

The modifications in the pull request have been tested against an IBM z/OS Communications Server. The following code fragment uses FTP to submit a batch job to the mainframe, and collects the results.

def parse_job_number_from(line)
  tokens = line.split('JOB')
  raise StandardError, "Error: The string 'JOB' was not found in the FTP response." unless tokens.length == 2

  job_number = tokens[1].split.first
  job_number.sub(/^0+/, '') # Remove leading zeros
end
    
Net::FTP.open(@ip_or_domain) do |ftp|
  ftp.login @uid, @pwd
  ftp.quote 'site filetype=jes'
  job_info = ftp.puttextfile @local_jcl_filepath
  job_number = parse_job_number_from job_info
  ftp.gettextfile "J#{job_number}", @local_results_file
end

@shugo shugo merged commit d7e97c2 into ruby:master Jun 1, 2024
15 checks passed
@shugo
Copy link
Member

shugo commented Jun 1, 2024

It looks good. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Implement the 'literal' or 'quote' subcommands
2 participants