unix commands

19
Unix commands: 1) /a100/apps/hrdevl/joutput – path where o/p files are located in HCMDEVL Alias – ‘hdj’ a) mv .profile .profile.backup Take a back up of my profile in my root directory b) cp .profile <path> --> moves the .profile file in path hrdevl/cntl to home/thomav07 Copy the new profile C) The below command will help to edit this control file 2) ‘ll ZA_P9690_15*’ – lists all files which begin with ZA_P9690_15 in the location where command is run. This command will also show the permissions of the job or step. SQR and Com scripts should be

Upload: sivanbl

Post on 04-Dec-2015

276 views

Category:

Documents


7 download

DESCRIPTION

Unix Commands

TRANSCRIPT

Page 1: Unix Commands

Unix commands:

1) /a100/apps/hrdevl/joutput – path where o/p files are located in HCMDEVL

Alias – ‘hdj’

a) mv .profile .profile.backup

Take a back up of my profile in my root directory

b) cp .profile <path> --> moves the .profile file in path hrdevl/cntl to home/thomav07

Copy the new profile

C) The below command will help to edit this control file

2) ‘ll ZA_P9690_15*’ – lists all files which begin with ZA_P9690_15 in the location where command is run. This command will also show the permissions of the job or step. SQR and Com scripts should be in execute mode also. Job script and jil script should be in which mode? Control cards and i/p files can be in read and write modes only

‘Chmod 755 <name of com script>’ – changes the permissions to the com script

Page 2: Unix Commands

755/ 775 permissions can be used => 1st position denotes user permission, 2nd position denotes group permission, 3rd position denotes all. 7 denotes full permission and 5 denotes read/ write permission

3) ‘fsj ZA_P9690_15’ – Force starts the job (or step) irrespective of the starting condition

4) ‘jr ZA_P9690’ – shows the status of the job

5) jr ZA_P9690 -ql0 - this command will give the run calendar attached to the job

6) Escape key + K => will keep giving you the previous commands executed as many times as you give the command

7) Space key will move right

8) Right arrow will delete all details in the right

9) Check the code written into a com script using Vi command and not cat command since this will show any control characters if present

Page 3: Unix Commands

10) dos2unix <com scriptname/sqr script> <comscriptname/sqr script> => this will remove the control characters if present in the com script file.

‘dos2unix usbn0550.sqr’

11) If you are in VI editor to come out select esckey and ‘:q’ = to quit without saving the changes

12) If you are in VI editor to come out select esckey and ‘:q!’ = to quit without saving the last changes

13) If you are in VI editor to come out select esckey and ‘:wq’ = to quit after saving the changes

14) Esc ‘dd’ => delete the entire line backwards

15) Ctrl + ‘u’ to scroll up – SQR’s will be big and only part will be displayed. Scroll to view the rest of the file

16) Ctrl + ‘d’ to scroll down

17) if you are viewing a file too large using the vi command and you want to scroll to the end of the file press - shift G

18) If you want to go right up press Esc:1

19) Shift + 'g' to come to end of file/ line

20) If you want to see the entire jil script that has been loaded

'jr ZA_P9690 -q'

Page 4: Unix Commands

18) will show the entire file

19) When we create a job we should block the name of the JOB and AUTOSYS JOB in production so that no one else would start to use the same name for their jobs. This should also be done for the SQR if it is there in the job

a) Manage Development > System Information > Programs >save here the SQR and job

Page 5: Unix Commands
Page 6: Unix Commands

b) Manage Development > Autosys > Autosys Job

Page 7: Unix Commands

20) File Locations

a) COBOL file location

Dev:Actual: /a100/apps/psoft/hcmdevl/pf_mod/srcSoft Link: /a100/apps/hrdevl/src

hdsrc

b) SQL File location:

Prod:Actual: /a100/apps/psoft/h8gprod/pf_mod/sqlSoft Link: /a100/apps/hrprod/sql

c) SQR File Location

Prod:Actual: /a100/apps/psoft/h8gprod/pf_mod/sqrSoft Link: /a100/apps/hrprod/sqr

Page 8: Unix Commands

Note: If requirement is to modify an existing SQR, check if the SQR is present in overide path

a100/apps/hrprod/ovride/sqr

If present take a copy of this SQR and modify

Else take from the original path

d) Control cards

/a100/apps/hrdevl/cntl

e) Script Path

Prod:Actual: /a100/apps/psoft/h8gprod/pf_mod/scriptSoft Link: /a100/apps/hrprod/script

Autosys profile scripts are located in the /job subdirectory.Autosys command scripts are located in the /com subdirectory.Note: All scripts (job and com) should be in lower case only

Whenever possible, command scripts will be named for the SQR, COBOL, AE, or utility that the script is designed to run. This type of script will be named “com_report.” followed by the program name (i.e. com_report.PSPPYRUN, com_report.uspy0239, com_report.xrx)

If the command script must be unique to a job step, the script name will be made up of the job name and step number separated by a dot. (i.e. p9232.10). This naming convention should only be used if it is impossible to use the more generic script naming convention given above.

e) Benefits i/p and o/p file location

/a100/apps/hrdevl/data/tbadm00

21) If unable to change the mode of a file using chmod - try the steps

a) lock the object in STAT b) then do i.own <Object name> c) Then try to chmod

Page 9: Unix Commands

If still it does not change request to infra team

22) to change directory use command 'cd'.

to see the permission of jil go to home jil directory and give 'll ZA_P9699' or 'ls -ltr ZA_P9699.jil'

'cd /' - will go to root directory

23) For ACQ1 & 2 it is the same environment

/a100/apps/hrwconv/script/job - alias hwsc

24) 'Esc' plus '/' and then type the character to find

25) n - for next 26) Down Arrow for next line

a) in vi editor Esc then 'a' enter will go to next line provided the cursor is in the end of current line

b) esc plus a will go to previous character and esc plus x will remove that character

26) While creating archive sets for batch objects - Copy from working should be selected as no

Page 10: Unix Commands

27) When loading jil into other instances steps can be ignored - just select enter

28) windows + e goes to C drive

29) inorder to execute jil from a particular location - load to the particular instance and then run like

fsj HCMACQ1_P9699

30) Command to change a job status to success

sendevent -e CHANGE_STATUS -s SUCCESS -j ZA_P8832

31) 'findjob hrusi121' - this will give the job that runs the SQR

32) a) For FTP File transfer to a shared drive location we have to make an entry in Path: /a100/apps/hrdevl/cntlControl Card: FTP_CNTL_TBL - the entry in this should be the entire path of the FTP Example:P969910A,MOPFTP,,psbenadmin_nj/Shared Services/Benefits Administration Team/King/Census,,put,,SAVE,,,1,+_%Y%m%d,txt

To enable it make an entry in control card: HRS.FTP.ENABLED

in this control card make entry likeJOB:JOBSTEP:O/C - runs only for the mentioned job steporJOB:JOB:O/C - runs for all steps in the entire job

example: If job name is ZA_P9699 and job step name is ZA_P9699_10A_FTP entry should be like:P9699:P969910A:Owhere O-once - places the file in the location only once. The next time the program is run it will not be placed in the locationC-continuous - places the file in the location every time the program is run

Page 11: Unix Commands

Since P9690 and 9699 were run once 'O' is not seen in the control card anymore

This entry to enable the FTP transfer needs to be done in the respective instances - even in H8GPROD by ourselves

b) 1) For sending email create a control card example: MAIL_RECIP_BENHW where MAILRECIP_ should be general to the name of the control cardEnter the email address in the control card. 2) To enable the send email function create a control card example: HRS.MAIL.ENABLED.THOMAV07HRS.MAIL.ENABLED. - Common to all such control cards and THOMAV07 - is the NT ID 3) Make an entry in the control card likejob: jobStep: c/o - similar to as in FTP entry 4) When this control card is uploaded in path /a100/apps/hrdevl/cntl a program that runs automatically updates the HRS.MAIL.ENABLED control card

Page 12: Unix Commands

Email sending is always enabled in H8GPROD. So we need not enable it in this instance alone

33)

grep -i pattern file

When trying to find if a record or field is used anywhere check in sqr,sql,copylib (/a100/apps/hrprod/copylib) and src folders

grep -i 'ps_z_annbencom_tbl' *.* <This command will for the references of the mentioned characters in the path. i - is to make the search case insensitive. *.* means all files. any extn> grep -i 'z_legacy_wl_sw' *.* hpsrc cd ../src grep -i 'z_legacy_wl_sw' *.* hpsql grep -i 'z_legacy_wl_sw' *.* cd .. cd .. cd psoft ll cd h8gprod

Page 13: Unix Commands

cd sqr ll

To find in which jil's a com script is used - go to file path as belowcd /a100/apps/hrprod/pmove/jiland then give the grep commandgrep -i 'com_report.usbn0549'*.*

34) 'history' - this command will list all the history commands executed

grep -i 'z_legacy_wl_sw'

35) cd ../ change backward by two directories or folders

exampleif we are at a100/apps/hrdevl it will change to a100

36) Esc key and ' k' will display the last used commands. Keep pressing K to go to previous used commands

37) h1pj - short cut for path:/a100/apps/hrrel1/pmove/jil or /a100/apps/hruat/pmove/jil

Go to this path and give the below command.We can see the jil errors in the log and error file

ls -ltr

38) Which <File name> could be the command to see the location of the file39) /a100/apps/hruat/copylib - is the path of cobol file formats like TBA006F40) as.se. HCMACQ2_P8960_10A hold This command will put the job step on hold

as.se HCMACQ2_P8960_10A off_hold => Off Hold Note: This will cause the step to start runningas.se HCMACQ2_P8960_10A inactive => This will not start off the step

Note: When steps of a job are in AC (active) status, when you start one step say step 10, if the next step say 20 is dependent on 10th step's success condition it will run after step 10 goes to success and so on. So all following steps will start depending on the starting condition.But if the steps of a job are in any other status say IN (Inactive) status then fsj of step 10 will not trigger the next step dependent on this step. You have to fsj the next step if you want to start it

How do we make all steps of a job to active?First put the first step say the 05 step on hold and then force start the job and you will have all steps in Active (except of course the 05 step)41) It is in this control card that we need to make an entry for our job step to ovride the sysdate to the date mentioned in this file, in production. Cant do this by our self need to contact some one else

The file, MJ_SYSDATE_BY_JOB, is tucked away in the H8GPROD home directory (/a100/home/hrprod).

Screen shot of file MJ_SYSDATE_BY_JOB from prod

Page 14: Unix Commands

In other instances we need to make an entry in HRSYST.SYSDATE control card by sending the control card HRSYST.SYSDATE.THOMAV07

Screen shot of file HRSYST.SYSDATE from HCMACQ3

42) To place an sqr in ovride path in production:Note: 1) when you place an sqr in ovride path in production, it will be in the ovride path only for 48hrs after which Dwyer, Don E has to be approached for extending the sqr's presence in the ovride path.

Page 15: Unix Commands

2) When sqr is placed in ovride path Don will be intimated automatially

Steps:1) place the sqr in home directory (/home/manohs)

2) In Putty login to chrprd2 and execute the below command from the home directory(you can go to home directory using command cd /home/manohs)

add.ovrd usbn0549.sqr

To delete the sqr from ovride path try del.ovrd usbn0549.sqr after changing directory cd /a100/apps/hrprod/ovride/sqrif not possible (we will actually not have access to delete sqr from ovride path in prod) send email to Dwyer, Don E.

43) Path to find People soft delivered sqc's and sqr's/a100/apps/psoft/h8gprod/sqr

44) jilChecker ZA_P4700 - This command will give details all about the jil45) Creating and managing jobs (We need to get the job and SQR name from production people soft and then create an autosys job) 1) Get/ create the job name using add option and enter the data as seen in below screen shot

Page 16: Unix Commands

2) Get/ create SQR name using add option and enter details as seen in below screen shot

3) Go to Manage Development > Autosys > Autosys Job and create the autosys job name with the job name you have created using step 1

46) Command to find job dependencies

job_depends –J ZA_P9106 -c

47) To kill a job

48) Below will illustrate the set up for VistaThe config file needs to be included in the job script

Page 17: Unix Commands

Using hrscm utility we need to check out the config file for editing the rule

The entries in the cfg file will be as below:

1,2,13 and 1,1, 12 are the positions inside the report where the characters within quotes ("P910614C") will be found.1,1,12 => from 1st column 1st row 12th position1,2,13=> from 1st column 2nd row 13th position

Move the cfg file to /a100/apps/hrdevl/vista after entries are made. Note: Sometimes the file (say PSGLUS.cfg)cannot be moved i.e. overwritten. so first rename the existing .cfg file in vista folder to something like PSGLUSbkp.cfg and then move the file from local to this place.

Then check in and also load to staging for testing purpose and load to prod finally.Note: While doing check in, end the comments you enter with enter and then give the dot. Otherwise system will keep waiting for the dot so give dot again.

Page 18: Unix Commands

Note: Before moving to prod we need to move to staging. So perform check out, check in, move to staging and then to prod (Basically all the steps).

Now run your vista step (say step 20 of job P9102)

My File will be in /a100/apps/hrdevl/data/vistaRun job ZU_P8539 (This job will post the file to Vista server) and then check if the file is in success or fixing

If file is in fixing , it means there is an error in the config file. So make it right and we need to executevista_fixed *.*and then run the vista step followed by ZU_P8539 (THIS JOB WILL POST IT TO SUCCESS OR FIXING)