How to create a AS400 Qshell script (.sh) file

115 pts.
Tags:
AS/400 scripts
AS400 qshell script
Qshell
STRQSH
Hi, I want to run a command STRQSH CMD ('/REPORTGENERATOR/move2current.sh')

Where move2current would be a .sh file with commands as below: rm /HPA_CURRENT/_YOUR_AS400_NAME*.CSV cp /REPORTGENERATOR/*$(date '+%Y%m%d')* /HPA_CURRENT #set new owner chown hpa_transf /HPA_CURRENT/*.CSV

My question is how to create this move2current.sh file?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Use the EDTF command.
    EDTF  '/REPORTGENERATOR/move2current.sh'
    The EDTF command opens a simple text file editor. If the /REPORTGENERATOR directory is shared out to the network, then you can use any PC editor to create the script file. Tom
    125,585 pointsBadges:
    report
  • DeepikaR
    Thanks a lot Tom, I am able to run the script now. But i am getting the error for the below command: cp /REPORTGENERATOR/*$(date '+%Y%m%d')* /HPA_CURRENT The file name that exist in directory is in the format of "system_name+date+sequence number" What Do I need to edit in the above command to copy the files that have the substring of today's date. Regards, Deepika Rohilla
    115 pointsBadges:
    report
  • TomLiotta
    The file name that exist in directory is in the format of “system_name+date+sequence number” Please show one or two examples of actual report names. Tom
    125,585 pointsBadges:
    report
  • DeepikaR
    Hi, for example suppose the file name is "ABTT2011081900000450002" This is the report name for the server ABTT on 19th Aug 2011 for the report sequence number 45 for the report copy number 2. I want to retrieve similar kind of reports for a particular date irrespective of report sequence number and report copy number. I hope this information would be helpful to understand the query. Regards, Deepika Rohilla
    115 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following