forked from richardschoen/QshOni
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQSHONICMDS.PNLGRP
More file actions
1638 lines (1570 loc) · 47.8 KB
/
Copy pathQSHONICMDS.PNLGRP
File metadata and controls
1638 lines (1570 loc) · 47.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
:pnlgrp.
.************************************************************************
.*
.* QSHONICMDS.PNLGRP - Complete Command Help for QshOni Project
.*
.************************************************************************
.************************************************************************
.* Primary Help for command QSHEXEC
.************************************************************************
:help name='QSHEXEC'.
Run Qshell Command Line - Help
:p.The Run Qshell Command Line (QSHEXEC) command can be used to run a QSH/PASE command and log the results
appropriately.
:p.The following example calls the ls command to list files for the /tmp directory:
:XMP.
:hp2.
QSHEXEC CMDLINE('cd /tmp;ls')
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHEXECLOG)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
:ehp2.
:EXMP.
:p.The following example runs an SQL query with db2util and exports the results as JSON to the QTEMP/STDOUTQ
:XMP.
:hp2.
QSHEXEC CMDLINE('export DB2UTIL_JSON_CONTAINER=array;db2util -o json "select * from qiws.qcustcdt"')
DSPSTDOUT(*YES)
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHEXEC/CMDLINE'.
:IMHELP NAME='COMMON/CMDLINE'.
:ehelp.
:help name='QSHEXEC/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHEXEC/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHEXEC/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHEXEC/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHEXEC/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHEXEC/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHEXEC/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHEXEC/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHEXEC/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHEXEC/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHEXEC/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHEXEC/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHEXEC/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHEXEC/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHEXEC/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHEXEC/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHEXEC/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
.************************************************************************
.* Primary Help for command QSHEXECSRC
.************************************************************************
:help name='QSHEXECSRC'.
Run Qshell .sh Script from Src - Help
:p.The Run Qshell .sh Script from Src (QSHEXECSRC) command can be used to run a
QSH/PASE command shell script from a classic source physical file member
and log the results appropriately.
:P.
The use case would be for an app where you want to store your
QShell/PASE/Python/PHP/Etc. scripts as part of your library source and
execute those scripts directly from a source physical file.
:p.The following example calls a QShell source member QSHELL01 stored in
source file QSHONI/SOURCE to run the ls command to list files for the /tmp directory:
:XMP.
:hp2.
QSHEXECSRC SRCFILE(QSHONI/SOURCE)
SRCMBR(QSHELL01)
CMDPARM(' ')
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHEXECLOG)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
RMVTMPSCR(*YES)
PROMPTCMD(*NO)
:ehp2.
:EXMP.
:p.Sample QShell source member: QSHONI/SOURCE(QSHELL01) Type: TXT Text: QShell
script to List Files in /tmp folder
:XMP.
:hp2.
cd /tmp
ls -l
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHEXECSRC/SRCFILE'.
:IMHELP NAME='COMMON/SRCFILE'.
:ehelp.
:help name='QSHEXECSRC/SRCMBR'.
:IMHELP NAME='COMMON/SRCMBR'.
:ehelp.
:help name='QSHEXECSRC/CMDPARM'.
QSH script command line parms (CMDPARM) - Help
:xh3.QSH script command line parms (CMDPARM)
:IMHELP name='COMMON/CMDPARM'.
:ehelp.
:help name='QSHEXECSRC/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHEXECSRC/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHEXECSRC/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHEXECSRC/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHEXECSRC/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHEXECSRC/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHEXECSRC/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHEXECSRC/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHEXECSRC/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHEXECSRC/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHEXECSRC/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHEXECSRC/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHEXECSRC/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHEXECSRC/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHEXECSRC/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHEXECSRC/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHEXECSRC/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
:help name='QSHEXECSRC/RMVTMPSCR'.
:IMHELP NAME='COMMON/RMVTMPSCR'.
:ehelp.
:help name='QSHEXECSRC/PROMPTCMD'.
:IMHELP NAME='COMMON/PROMPTCMD'.
:ehelp.
.***********************************************************************
.* Command-specific help for QSHBASH
.***********************************************************************
:HELP NAME='QSHBASH'.
Run Bash command (QSHBASH) - Help
:p.
This CL command can be used to run a PASE bash command
and log the results appropriately.
:p.
The command is a convenience wrapper that can be used to call
a bash command with QSHEXEC instead of having to type the
following bash command sequence prefix on a
QSHEXEC command line: :hp2.bash -c cmdline:ehp2.
:p.The following example calls the ls command to list files for the /tmp directory using the bash command:
:XMP.
:hp2.
QSHBASH CMDLINE('cd /tmp;ls')
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHEXECLOG)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
:ehp2.
:EXMP.
:p.The following example runs an SQL query with db2util and exports the results as JSON
to the QTEMP/STDOUTQSH outfile:
:XMP.
:hp2.
QSHBASH CMDLINE('export DB2UTIL_JSON_CONTAINER=array;db2util -o json "select * from qiws.qcustcdt"')
DSPSTDOUT(*YES)
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHBASH/CMDLINE'.
Bash command line (CMDLINE) - Help
:xh3.Bash command line (CMDLINE)
:p.Bash command line sequence to run. Semicolons can be used to run multiple commands.
:parml.
:pt.:pv.character-value:epv.
:pd.Enter a valid Bash command line, or script filename if in PATH.
:eparml.
:P.
:IMHELP NAME='COMMON/REQPARM'.
:ehelp.
:help name='QSHBASH/CMDLINEDLM'.
Bash command line delimiter (CMDLINEDLM) - Help
:xh3.Bash command line delimiter (CMDLINEDLM)
:p.Specifies the command line delimiter for Bash commands.
:parml.
:pt.:pk def.*SGLQUOTE:epk.
:pd.Defaults to single quote, which is what it has been since inception.
:pt.:pk.*DBLQUOTE:epk.
:pd.Uses double quotes instead of single quotes.
:pt.:pk.*NONE:epk.
:pd.No delimiter is used.
:pt.:pk.character-value:epk.
:pd.Enter a custom delimiter character.
:eparml.
:ehelp.
:help name='QSHBASH/DEBUGCMD'.
Debug bash command line (DEBUGCMD) - Help
:xh3.Debug bash command line (DEBUGCMD)
:p.Allows the developer to prompt and see the actual bash command line that is being called.
:parml.
:pt.:pk def.*NO:epk.
:pd.Do not debug the command line.
:pt.:pk.*YES:epk.
:pd.Debug the command line.
:eparml.
:ehelp.
:help name='QSHBASH/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHBASH/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHBASH/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHBASH/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHBASH/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHBASH/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHBASH/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHBASH/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHBASH/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHBASH/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHBASH/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHBASH/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHBASH/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHBASH/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHBASH/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHBASH/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHBASH/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
.************************************************************************
.* Primary Help for command QSHBASHSRC
.************************************************************************
:help name='QSHBASHSRC'.
Run Bash .sh Script from Src - Help
:p.The Run Bash .sh Script from Src (QSHBASHSRC) command can be used to run a
bash command shell script from a classic source physical file member
and log the results appropriately.
:P.
The use case would be for an app where you want to store your
Bash/QShell/PASE/Python/PHP/Etc. scripts as part of your library source and
execute those scripts directly from a source physical file.
:p.The following example calls a bash source member QSHELL01 stored in
source file QSHONI/SOURCE to run the ls command to list files for the /tmp directory:
:XMP.
:hp2.
QSHBASHSRC SRCFILE(QSHONI/SOURCE)
SRCMBR(QSHELL01)
CMDPARM(' ')
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHBASHLOG)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
RMVTMPSCR(*YES)
PROMPTCMD(*NO)
:ehp2.
:EXMP.
:p.Sample bash source member: QSHONI/SOURCE(QSHELL01) Type: TXT Text: Bash script to List Files in /tmp fold
:XMP.
:hp2.
cd /tmp
ls -l
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHBASHSRC/SRCFILE'.
:IMHELP NAME='COMMON/SRCFILE'.
:ehelp.
:help name='QSHBASHSRC/SRCMBR'.
:IMHELP NAME='COMMON/SRCMBR'.
:ehelp.
:help name='QSHBASHSRC/CMDPARM'.
Script command line parms (CMDPARM) - Help
:xh3.Script command line parms (CMDPARM)
:IMHELP name='COMMON/CMDPARM'.
:ehelp.
:help name='QSHBASHSRC/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHBASHSRC/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHBASHSRC/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHBASHSRC/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHBASHSRC/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHBASHSRC/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHBASHSRC/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHBASHSRC/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHBASHSRC/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHBASHSRC/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHBASHSRC/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHBASHSRC/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHBASHSRC/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHBASHSRC/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHBASHSRC/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHBASHSRC/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHBASHSRC/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
:help name='QSHBASHSRC/RMVTMPSCR'.
:IMHELP NAME='COMMON/RMVTMPSCR'.
:ehelp.
:help name='QSHBASHSRC/PROMPTCMD'.
:IMHELP NAME='COMMON/PROMPTCMD'.
:ehelp.
.************************************************************************
.* Primary Help for command QSHCURL
.************************************************************************
:help name='QSHCURL'.
Run Curl Command via Qshell - Help
:p.Run Curl Command via Qshell (QSHCURL) command to run a PASE curl command and
log the results appropriately.
:P.
The command is a convenience wrapper that can be used to call a curl command with QSHEXEC
instead of having to type the following full curl command sequence prefix on a
QSHEXEC command line: curl http://www.sitename.com -o /tmp/curlout.txt
:P.
:HP2.
curl must be installed in your PASE/QSH environment in /QOpensys/pkgs/bin before this will work
To install curl from qshell/bash: yum install curl
:EHP2.
:p.The following example calls the curl command to download the google home page site contents
to an IFS file. You only need to pass the parms after curl.
:XMP.
:hp2.
QSHCURL CMDLINE('http://www.google.com -o /tmp/curlout.txt')
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHEXECLOG)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
:ehp2.
:EXMP.
:p.The following example calls the curl command with the --help flag to display the curl parms available
:XMP.
:hp2.
QSHCURL CMDLINE('--help') DSPSTDOUT(*YES)
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHCURL/CMDLINE'.
Curl command line parms (CMDLINE) - Help
:xh3.Curl command line parms (CMDLINE)
:p.Specifies the curl command line sequence to run.
:ehelp.
:help name='QSHCURL/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHCURL/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHCURL/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHCURL/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHCURL/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHCURL/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHCURL/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHCURL/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHCURL/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHCURL/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHCURL/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHCURL/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHCURL/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHCURL/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHCURL/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHCURL/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHCURL/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
.************************************************************************
.* Primary Help for command QSHPYRUN
.************************************************************************
:help name='QSHPYRUN'.
Run Python Script via Qshell - Help
:p.The Run Python Script via Qshell (QSHPYRUN) command is used to run a Python script
via QSHEXEC and log the results appropriately.
:p.The following example calls a helloworld.py script that write to STDOUT.
:XMP.
:hp2.
QSHPYRUN SCRIPTDIR('/pythonapps')
SCRIPTFILE('hello.py')
ARGS(Parm1 Parm2)
PYVERSION(3)
DSPSTDOUT(*YES)
LOGSTDOUT(*NO)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)
IFSSTDOUT(*NO)
IFSFILE('/tmp/log.txt')
IFSOPT(*REPLACE)
PRTSPLF(QSHPYRUN)
PRTUSRDTA(*NONE)
PRTTXT(*NONE)
:ehp2.
:EXMP.
:IMHELP NAME='COMMON/LOGGINGNOTE'.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHPYRUN/SCRIPTDIR'.
Python script directory (SCRIPTDIR) - Help
:xh3.Python script directory (SCRIPTDIR)
:p.The IFS directory location for the Python script. :hp2.Ex: /python:ehp2.
:ehelp.
:help name='QSHPYRUN/SCRIPTFILE'.
Python script file name (SCRIPTFILE) - Help
:xh3.Python script file name (SCRIPTFILE)
:p.The script file name you want to call without the directory path.
The QSHPYRUN command puts it all together. :hp2.Ex: hello.py:ehp2.
:ehelp.
:help name='QSHPYRUN/ARGS'.
Python command line arguments (ARGS) - Help
:xh3.Python command line arguments (ARGS)
:p.Command line parameter argument list.
:p.Up to 40 - 200 byte argument/parameter values can be passed to a Python script call.
:P.Each parm is automatically trimmed. Do NOT put double quotes around the parms or your program call
may get errors because your parameters get compromised with extra double quotes.
:P.The double quotes are already added automatically inside the CL command processing program.
Single quotes are allowed around your parmaeter data though if desired:
:hp2.Ex: 'My Parm Value 1' 'My Parm Value 2':ehp2.
:ehelp.
:help name='QSHPYRUN/ARGDLM'.
Command line argument delimiter (ARGDLM) - Help
:xh3.Command line argument delimiter (ARGDLM)
:parml.
:pt.:pk def.*DBLQUOTE:epk.
:pd.Double quotes are used to delimit the command line arguments.
:pt.:pk.*SINGLE:epk.
:pd.Single quotes are used to delimit the command line arguments.
:pt.:pk.*NONE:epk.
:pd.No delimiter is used.
:eparml.
:ehelp.
:help name='QSHPYRUN/PYVERSION'.
Python version (PYVERSION) - Help
:xh3.Python version (PYVERSION)
:p.Specifies the Python version to use to run the script.
It should be set to either 2 or 2.7 for Python 2 or 3, 3.6 or 3.9 for Python 3.
:ehelp.
:help name='QSHPYRUN/PYPATH'.
Python bin path (PYPATH) - Help
:xh3.Python bin path (PYPATH)
:p.The this is the directory path to your Python binaries (python/python3).
:p.Hopefully you have already installed the Yum versions so the default path should be good.
Leave value set to *DEFAULT. Default= /QOpenSys/pkgs/bin.
The default path lives in the PYPATH data area in the PYONI library.
:ehelp.
:help name='QSHPYRUN/SETPKGPATH'.
:IMHELP NAME='COMMON/SETPKGPATH'.
:ehelp.
:help name='QSHPYRUN/USEVENV'.
Use virtual environment (USEVENV) - Help
:xh3.Use virtual environment (USEVENV)
:p.Use virtual environment.
:parml.
:pt.:pk.*YES:epk.
:pd.Run your Python script using an existing Python virtual environment as
specified in the Python virtual environment path.
The IFS directory and virtual environment must exist.
:p.
:hp2.Note: When using virtual environment, you will need to make sure the PYPATH
data area value is set to ' ' or pass ' ' to the PYPATH parameter to make sure the system level
python binary does not picked up. Each venv has its own python executable:ehp2.
:pt.:pk def.*NO:epk.
:pd.Do not use a virtual environment.
:eparml.
:ehelp.
:help name='QSHPYRUN/DSPSTDOUT'.
:IMHELP NAME='COMMON/DSPSTDOUT'.
:ehelp.
:help name='QSHPYRUN/LOGSTDOUT'.
:IMHELP NAME='COMMON/LOGSTDOUT'.
:ehelp.
:help name='QSHPYRUN/PRTSTDOUT'.
:IMHELP NAME='COMMON/PRTSTDOUT'.
:ehelp.
:help name='QSHPYRUN/DLTSTDOUT'.
:IMHELP NAME='COMMON/DLTSTDOUT'.
:ehelp.
:help name='QSHPYRUN/IFSSTDOUT'.
:IMHELP NAME='COMMON/IFSSTDOUT'.
:ehelp.
:help name='QSHPYRUN/IFSFILE'.
:IMHELP NAME='COMMON/IFSFILE'.
:ehelp.
:help name='QSHPYRUN/IFSOPT'.
:IMHELP NAME='COMMON/IFSOPT'.
:ehelp.
:help name='QSHPYRUN/CCSID'.
:IMHELP NAME='COMMON/CCSID'.
:ehelp.
:help name='QSHPYRUN/PRTSPLF'.
:IMHELP NAME='COMMON/PRTSPLF'.
:ehelp.
:help name='QSHPYRUN/PRTUSRDTA'.
:IMHELP NAME='COMMON/PRTUSRDTA'.
:ehelp.
:help name='QSHPYRUN/PRTTXT'.
:IMHELP NAME='COMMON/PRTTXT'.
:ehelp.
:help name='QSHPYRUN/PRTHOLD'.
:IMHELP NAME='COMMON/PRTHOLD'.
:ehelp.
:help name='QSHPYRUN/PRTOUTQ'.
:IMHELP NAME='COMMON/PRTOUTQ'.
:ehelp.
:help name='QSHPYRUN/OUTFILE'.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHPYRUN/MBROPT'.
:IMHELP NAME='COMMON/MBROPT'.
:ehelp.
:help name='QSHPYRUN/PASEJOBNAM'.
:IMHELP NAME='COMMON/PASEJOBNAM'.
:ehelp.
:help name='QSHPYRUN/DEBUGCMD'.
Debug QSHEXEC command (DEBUGCMD) - Help
:xh3.Debug QSHEXEC command (DEBUGCMD)
:parml.
:p.This parameter allows you to debug the command line that QSHPYRUN will run via QSHEXEC.
:pt.:pk.*YES:epk.
:pd.If set to *YES, your job must be running interactively and it will display the command line
that QSHPYRUN composed to execute via QSHEXEC before it runs.
:p.This is good for debugging or you are curious what the exec QSHEXEC command will look like.
Under the covers QSHPYRUN utilizes the QSHEXEC command to run the Python command line.
:pt.:pk def.*NO:epk.
:pd.Do not debug the command line.
:eparml.
:ehelp.
:help name='QSHPYRUN/CHGSCRDIR'.
Change script directory (CHGSCRDIR) - Help
:xh3.Change script directory (CHGSCRDIR)
:p.Specifies whether to change the current working directory to the script directory
before running the script.
:parml.
:pt.:pk def.*NO:epk.
:pd.Do not change the current working directory.
:pt.:pk.*YES:epk.
:pd.Change the current working directory to the script directory.
:eparml.
:ehelp.
.************************************************************************
.* Primary Help for command QSHLOGSCAN
.************************************************************************
:help name='QSHLOGSCAN'.
Scan the stdout outfile for the selected value - Help
:p.This CL command is a convenience command that can be used to scan a
STDOUT log for a specific value to indicate success or failure.
:p.The following example scans the outfile log in file QTEMP/STDOUTQSH for a
text value of :hp3.successfully:ehp3. somewhere in any line of the log file output:
:XMP.
:hp2.
MONMSG MSGID(CPF9898) EXEC(DO)
SNDPGMMSG MSG('Did not find string of success in program output.') TOUSR(RICHARD)
ENDDO
QSHLOGSCAN SCANFOR('successfully')
EXACTMATCH(*NO)
:ehp2.
:EXMP.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHLOGSCAN/SCANFOR'.
Value to scan for (SCANFOR) - Help
:xh3.Value to scan for (SCANFOR)
:p.Text value to scan for on each line in the stdout outfile.
:p.The value passed IS case sensitive and must match the value in the log file.
:ehelp.
:help name='QSHLOGSCAN/EXACTMATCH'.
Exact match (EXACTMATCH) - Help
:xh3.Exact match (EXACTMATCH)
:p.Exact match-*YES, Contains-*NO
:parml.
:pt.:pk def.*NO:epk.
:pd.At least one line must contain the value somewhere in the line.
Good for generic matching.
:pt.:pk.*YES:epk.
:pd.Value must match exactly and be the only thing on the selected line.
:eparml.
:ehelp.
.************************************************************************
.* Primary Help for command QSHQRYTMP
.************************************************************************
:help name='QSHQRYTMP'.
SQL Query Data to Temp Table - Help
:p.This CL command is a convenience command that can be used to run an
SQL data selection query and create an outfile of resulting data.
:NT.
The command returns a CPF9898 escape message on error. Otherwise a CPF9898 completion message.
:ENT.
:p.The following example queries all the records from table QIWS/QCUSCTDT and
places the result in to an output table named: SQLTMP0001 in library QTEMP.
:XMP.
:hp2.
QSHQRYTMP SQL('SELECT * FROM QIWS/QCUSTCDT')
OUTFILE(SQLTMP0001)
EMPTYERROR(*YES)
PROMPT(*NO)
:ehp2.
:EXMP.
:P.
The following data areas are auto-created in the current job library QTEMP to track resulting query info.
You can retreive a resulting record count or the name of the outfile to check for existence
in case it didn't get created for some reason such as query failure.
:XMP.
:hp2.
SQLQRYCNT - Query result record count.
SQLQRYFIL - Output file created by the query.
SQLQRYLIB - Output file library for the file created by the query.
:ehp2.
:EXMP.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHQRYTMP/SQL'.
SQL query (SQL) - Help
:xh3.SQL query (SQL)
:p.Enter an SQL SELECT statement to query some specific data.
:ehelp.
:help name='QSHQRYTMP/PARMS'.
SQL placeholder parm name (PARMS) - Help
:xh3.SQL placeholder parm name (PARMS)
:p.Enter up to 30 parameter placeholder values you want to replace dynamically
in your SQL statements at runtime. These are not required if you don't want to
dynamic parameter replacement.
:p.Ex: :hp2.@@LIB:ehp2. for library or :hp2.@@FILE:ehp2. for file.
:ehelp.
:help name='QSHQRYTMP/PARMVALS'.
SQL parm replacement values (PARMVALS) - Help
:xh3.SQL parm replacement values (PARMVALS)
:p.Enter up to 30 replacement values you want to replace dynamically in your SQL statements
at runtime. These values correspond with each placeholder value you set in the list of PARMS.
These are not required if you don't want to dynamic parameter replacement.
:p.Ex: :hp2.QIWS:ehp2. for library or :hp2.QCUSTCDT:ehp2. for file.
:ehelp.
:help name='QSHQRYTMP/OUTFILE'.
Temp file to receive results (OUTFILE) - Help
:xh3.Temp file to receive results (OUTFILE)
:p.This is the output file/table where data gets selected in to via an SQL query.
The table will get automatically created as a result of the query if it doesn't exist.
:IMHELP NAME='COMMON/OUTFILE'.
:ehelp.
:help name='QSHQRYTMP/EMPTYERROR'.
Escape error if no result data (EMPTYERROR) - Help
:xh3.Escape error if no result data (EMPTYERROR)
:p.This parameter determines whether a CPF9898 escape message is thrown if no records were selected by the q
:parml.
:pt.:pk def.*YES:epk.
:pd.Throw escape message if no records were selected.
:pt.:pk.*NO:epk.
:pd.Do not throw escape message if no records were selected.
:eparml.
:ehelp.
:help name='QSHQRYTMP/NAMING'.
Naming convention (NAMING) - Help
:xh3.Naming convention (NAMING)
:p.This parameter determines what format your queries are using: *SYS or *SQL.
:parml.
:pt.:pk def.*SYS:epk.
:pd.Use system naming convention for SQL queries.
:pt.:pk.*SQL:epk.
:pd.Use SQL naming convention for SQL queries.
:eparml.
:ehelp.
:help name='QSHQRYTMP/PROMPT'.
Prompt the RUNSQL statement (PROMPT) - Help
:xh3.Interactively prompt the RUNSQL statement (PROMPT)
:p.Specifies whether to prompt the RUNSQL command before running.
Only use this parameter in an interactive 5250 session.
:parml.
:pt.:pk def.*NO:epk.
:pd.Do not prompt the RUNSQL command.
:pt.:pk.*YES:epk.
:pd.Prompt the RUNSQL command.
:eparml.
:ehelp.
:help name='QSHQRYTMP/CRTIDCOL'.
Create row identity column (CRTIDCOL) - Help
:xh3.Create row identity column (CRTIDCOL)
:p.Specifies whether to allow adding of a unique identity column to your outfile table after it's created.
:parml.
:pt.:pk def.*NO:epk.
:pd.Do not add an identity column.
:pt.:pk.*YES:epk.
:pd.Add an identity column.
:eparml.
:ehelp.
:help name='QSHQRYTMP/IDCOLNAME'.
Record ID column name (IDCOLNAME) - Help
:xh3.Record ID column name (IDCOLNAME)
:p.Specifies the name of the identity column to add if CRTIDCOL is *YES.
RECID is the default name.
:ehelp.
.************************************************************************
.* Primary Help for command QSHQRYSRC
.************************************************************************
:help name='QSHQRYSRC'.
SQL Query Source to Temp Table - Help
:xh3.SQL Query Source to Temp Table (QSHQRYSRC)
:p.This CL command is a convenience command that can be used to run an SQL
data selection query and create an outfile of resulting data.
Instead of an SQL input statement parameter, the query pulls SQL source from a source member or IFS file mem
:NT.
The command returns a CPF9898 escape message on error. Otherwise a CPF9898 completion message.
:ENT.
:p.The following example queries all the records from table QIWS/QCUSCTDT and
places the result in to an output table named: SQLTMP0001 in library QTEMP.
It also replaces the selected placeholder parameters values in the SQL query that gets read from the source
:XMP.
:hp2.
QSHQRYSRC SQLLOC(*SRCMBR)
SRCFILE(QSHONI/SOURCE)
SRCMBR(SQLTEST3)
PARMS(@@LIB @@file)
PARMVALS(qiws qcustcdt)
:ehp2.
:EXMP.
:P.
The following data areas are auto-created in the current job library QTEMP to track resulting query info.
You can retreive a resulting record count or the name of the outfile to check for existence
in case it didn't get created for some reason such as query failure.
:XMP.
:hp2.
SQLQRYCNT - Query result record count.
SQLQRYFIL - Output file created by the query.
SQLQRYLIB - Output file library for the file created by the query.
:ehp2.
:EXMP.
:P.
:IMHELP NAME='COMMON/ASTERISK'.
:ehelp.
:help name='QSHQRYSRC/SQLLOC'.
SQL source from location type (SQLLOC) - Help
:xh3.SQL source from location type (SQLLOC)
:p.This parameter determines if the SQL query is sourced from a source member or an IFS file. Default is *SR
:parml.
:pt.:pk def.*SRCMBR:epk.
:pd.The SQL query is sourced from a source physical file member.
:pt.:pk.*IFSFILE:epk.
:pd.The SQL query is sourced from an IFS file member.
:eparml.
:ehelp.
:help name='QSHQRYSRC/SRCFILE'.
SQL source file (SRCFILE) - Help
:xh3.SQL source file (SRCFILE)
:p.This is the source file that contains the SQL query source member if SQLLOC is *SRCMBR.
:P.
The possible library values are:
:PARML.
:PT.:PK DEF.*LIBL:EPK.
:PD.
The library list is used to locate the SQL source file.
:PT.:PK.library-name:EPK.
:PD.
Specify the name of the library where the SQL source file is located.
:EPARML.
:ehelp.
:help name='QSHQRYSRC/SRCMBR'.
SQL source member (SRCMBR) - Help
:xh3.SQL source member (SRCMBR)
:p.This is the source member that contains the SQL query if SQLLOC is *SRCMBR.
:ehelp.
:help name='QSHQRYSRC/IFSFILE'.
SQL IFS file (IFSFILE) - Help
:xh3.SQL IFS file (IFSFILE)
:p.This is the IFS file that contains the SQL query if SQLLOC is *IFSFILE.
:ehelp.
:help name='QSHQRYSRC/PARMS'.
SQL placeholder parm name (PARMS) - Help
:xh3.SQL placeholder parm name (PARMS)
:p.Enter up to 30 parameter placeholder values you want to replace dynamically
in your SQL statements at runtime. These are not required if you don't want to
dynamic parameter replacement.
:p.Ex: :hp2.@@LIB:ehp2. for library or :hp2.@@FILE:ehp2. for file.
:ehelp.
:help name='QSHQRYSRC/PARMVALS'.
SQL parm replacement values (PARMVALS) - Help
:xh3.SQL parm replacement values (PARMVALS)
:p.Enter up to 30 replacement values you want to replace dynamically in your SQL statements
at runtime. These values correspond with each placeholder value you set in the list of PARMS.
These are not required if you don't want to dynamic parameter replacement.
:p.Ex: :hp2.QIWS:ehp2. for library or :hp2.QCUSTCDT:ehp2. for file.
:ehelp.
:help name='QSHQRYSRC/OUTFILE'.
Temp file to receive results (OUTFILE) - Help
:xh3.Temp file to receive results (OUTFILE)
:p.This is the output file/table where data gets selected in to via an SQL query.
The table will get automatically created as a result of the query if it doesn't exist.
:P.
The possible values are:
:P.
:PARML.
:PT.:PK DEF.SQLTMP0001:EPK.
:PD.
The SQLTMP0001 table is created in the QTEMP library by default.
:P.
:PT.:PK.database-file-name:EPK.
:PD.
Specify the name (library-name/database-file) of the temporary database file to create.