Error in JCL job - mainframe

I have the below job which runs on a zlinux server and it creates a trigger in a destination zOS system.
//WPLP0500 JOB (GBCRM,GBAWPL),'PLIW ESI TRIGGER',
// CLASS=A,REGION=32M,MSGCLASS=E
//STEP EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
But it is giving the below errors
STMT NO. MESSAGE
1 IEFC620I UNIDENTIFIABLE CHARACTER ON THE JOB STATEMENT
2 IEFC605I UNIDENTIFIED OPERATION FIELD
3 IEFC620I UNIDENTIFIABLE CHARACTER ON THE EXEC STATEMENT
Can anyone please guide me on this.

Now that your error messages are formatted, you can see that for 1 and three it is complaining about something "invisible".
Invisible things in JCL are non-printable characters. If you are able to look at that job output in hex, you will see exactly what the unprintable characters are.
For 2, it doesn't show you the character, but the problem is the same (likely).
My bet is that they are "ASCII-spaces", hex-code 20. Making the bet because otherwise you'd have seen them on the z/Linux system.
You haven't listed the content of file two of the spool for your JOB, from which it may be possible to tell more, but your problem is "non-display" characters on your JCL cards. Probably ASCII-spaces. Perhaps not.

It would appear that you have omitted // on all lines (if the space before the jobname (WPLP0500) is coded would also cause issues). try :-
//WPLP0500 JOB (GBCRM,GBAWPL),'TRIGGER',
// CLASS=A,REGION=32M,MSGCLASS=E
//STEP EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
Note that the last line is superfluous as program IEFBR14 does not produce any output. In fact the program effectively just returns i.e. it Branches to the value held in Register 14, which, at program start, contains the return address.

Related

The current date parameter not adding to file in jcl

//STEP001 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXX.T.KR0A9N99.XXXIFRDK.PARM,
// DISP=SHR
//SORTOUT DD DSN=XXX.T.KR0A9N99.XXXIFRDK.PAR1,
// DISP=SHR
//SYSIN DD DSN=XXX.T.KR0A9N99.TWT.PARM(XXX#DATE)
// DISP=SHR
Inside this file XXX.T.KR0A9N99.XXXIFRDK.PARM
----+----1----+----2----+----3----+----4----+----5----+----6----+
***************************** Top of Data ***********************
open xxxF01Q#SDTPRD.fbabank.com
CD SDT_WINDSS/Download/
LSITE trailing_blanks=yes
SPUT //'xxx.T.KR0A9N99.xxxDHOLA.CSVF.SR0096(0)' HOLD.20190524.CSV
QUIT
inside parm XXX.T.KR0A9N99.TWT.PARM(XXX#DATE)
OPTION COPY
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'SPUT'),OVERLAY=(54:&DATE1))
the job went successful but not updated the current date for this file HOLD.20190524.CSV.. could you please help me to get correct date?
This may be a SYSIN RECFM issue. It sounds as if your SORTOUT file equals your SORTIN file. If so, that means the condition is never true. One explanation could be that, because of the RECFM, the argument SPUT might not be in position 1 the way it appears to be in the ispf screen shot. For example, if the RECFM of the SYSIN file happens to be FBA then, although the value appears to be in column 1, it would really be in column 2. If the input file is VBA or VB then the value would be offset by either 2 or 4.
It would be interesting to know the RECFM of the SORTIN file.

Find the line number of particular record using JCL

I have a input PS file like
aaa1111zzzz
bbb2222bbbb
ccc3333bbbb
ddd3333cccc
eee7777yyyy
I want to know the line number in this input PS file where the word '3333' is present.. output should be something like
3
4
in this scenario
I am looking for a JCL that can do this, I have searched in net, but no luck.
You seem to mis-understand what JCL is.
JCL is not executable, it does not look at data, it does not manipulate data.
JCL is like a memo from you to the operating system requesting the OS to run some programs.
When the JCL is read the OS reads it and sets up whatever it requires to do the tasks defined in the JCL and then DISCARDS the JCL i.e. writes it to the output spool.
The OS then runs the program(s) in accordance with the information it has extracted.
Now, for your task, cschneid has pointed you to one solution. You will have to manipulate the report from superc to get it as you posted.
Or, you can use your sort product as follows:
When reading the records in you ask sort to assign a sequence number to each record. When writing the records out you ask sort to only refer to the records with the value you are looking for and only write out the sequence number for those records.
With respect to NicC's answer, I've tried using SORT to attain the expected result.
//SORT EXEC PGM=SYNCSORT
//SORTIN DD *
aaa1111zzzz
bbb2222bbbb
ccc3333bbbb
ddd3333cccc
eee7777yyyy
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1:SEQNUM,3,ZD,4:1,11)
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,INCLUDE=(7,4,ZD,EQ,3333),OUTREC=(1:1,3)
/*
It's a different approach than most people take, but don't forget you can actually use z/OS UNIX Services utilities for tasks like this. In your example, "grep -nr pattern file" would find all the lines matching "pattern" and show you the line numbers.
Of course, the trick is getting the "file" part right when your data is in a conventional dataset...sometimes, easiest is something like this:
cat "//'my.dataset.name'" | grep -nr pattern
To run this in JCL, you'd put the above command as input into BPXBATCH using JCL like this:
//jobname JOB ...
// EXEC PGM=BPXBATCH
//STDERR DD PATH='/tmp/mystd.err',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//STDOUT DD PATH='/tmp/mystd.out',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
//STDPARM DD *
SH cat "//'my.dataset.name'" | grep -nr pattern
If you want the STDOUT/STDERR somewhere else (say, SYSOUT), just change the STDERR/STDOUT DD statements.
Using UNIX Services this way is a very cool thing if you're already familiar with UNIX/Linux shell commands...read the details here: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxa400/toc.htm

Vim discards input characters at startup

I have been driven crazy for years with Vim's behavior of throwing away input characters. I start vim like this:
$ vim file.c
and then immediately begin typing commands. However, Vim discards some of those characters, causing the wrong action to take place.
Is there something we can put in the .vimrc to solve this issue?
Vim should be able to change the TTY to raw mode without flushing buffered input.
Update: the issue is more precisely characterized, thanks to the following investigation method. I created a script called delayvim which contains:
#!/bin/sh
sleep 2.0
vim "$#"
Now during this two second pause I can type something like iabc<ESC> and then when Vim comes up, everything is cool: the command is processed, abc is inserted and Vim pops back into command mode, with the cursor backed up over the c. Thus, it is not simply flushing the TTY input buffer.
However, if I keep typing during this delay, for instance iabcdefghijk..., it will sometimes lose a letter or two of the alphabet that is typed right around the time when the sleep terminates and the editor launches. For instance, here is the result of one trial I just performed:
abcdefghilmn_
~
~
Where are jk, oops? I am sure I typed them. I didn't type very fast; my cadence was around 4-5 strokes per second, yet two consecutive events disappeared.
Basically, it might be trying to interrogate the terminal, and in the process discarding the input that is mixed up in the response. Or it could be a combination of reading some of the prior input, then flushing the input buffer and losing the rest.
2 points that might help:
1) are you being sure to hit i first, to enter input mode, so that all characters you type afterward should go ahead and be seen in your buffer (on the screen?). Otherwise the letters you type will be processed as commands, which will often do nothing, especially if you're starting an empty file.
Note that a and o are other common commands for telling vim that you are about to begin inserting text starting with the next keystroke.
2) In case the reason on your system has to do with speed, you can look for options to change what happens at startup. For example, if you put this in your .vimrc file
autocmd VimEnter * :sleep 5
Then after processing other startup files, vim or gvim will literally do nothing for 5 seconds before showing your file on the screen. On my system, I was able to type iabcdef during those 5 seconds and when the time was up, I did see abcdef entered into my text file.
If your file was not empty, beware, as (depending on your settings) your vim installation might be kindly returning you to the last place you were editing inside the file, and you will have inserted the text there, instead of at the start.
If this doesn't work, you could try to find other things vim can do (on the web, or using :help from within vim) and program it using autocmd to happen at startup to see if it helps.

Stacked IF NOTs

dd = (re.findall(r'">County<(.*?)</td>', lmth2))
if not dd:
dd = (re.findall(r'<small>Location in <a(.*?)</td>',lmth2)
if not dd:
county.append("")
fin.append(name[o]+';'+address[o]+';'+city[o]+';'+stateorg[o]+';'+county[o]+';'+phone[o]+';'+website[o])
continue
else:
ee = (re.findall(r'title="(.*?) County', dd[0]))
county.append(ee[0])
fin.append(name[o]+';'+address[o]+';'+city[o]+';'+stateorg[o]+';'+county[o]+';'+phone[o]+';'+website[o])
I'm trying to stack IF NOTs together to find the find result. If
If dd does not come up as a match then I want to try the second scenario. If that doesn't come up with a match then I want, for right now, for it to show it as nothing comes up and to set up the line to be saved to the file. If it does come up with a match than I need it continue on find the second level of the search with ee = (re.findall...)
Until I found the second possible scenario to search for everything had been working find but then I found another possible thing I need to look for so I'm trying to add it into the program and I keep getting an Invalid Syntax coming back on the : on the second
if not dd:
This is one that is WAY beyond me. I'm not use to having this trouble with stacked if's when I use to use VB6. Python seems to be handling things a bit differently.
Indentation is syntactically significant in Python. Unlike languages where blocks are determined by tokens like begin and end or { and }, in Python blocks are determined by indents and dedents.
As such, you cannot arbitrarily indent Python code. Whenever Python encounters a line that is indented further than the line above it, it expects that to be the first line of a new block. The issue you have is that inside the first if statement you have already established the indentation level of that block with the line dd = ..., and then you've indented the next if statement even further, while it should be at the same indentation level.
If you remove the extra indent on the second if not dd: line, it should no longer have a syntax error.

Converting header or text file information to code using Linux/Vim

I found myself writing a really simple conversion from OpenCL error codes to a human readable string. The 50 or so different codes are defined in a header file like this:
...
#define CL_INVALID_CONTEXT -34
#define CL_INVALID_QUEUE_PROPERTIES -35
#define CL_INVALID_COMMAND_QUEUE -36
#define CL_INVALID_HOST_PTR -37
...
I put all of these in a huge switch/case using expert copy/pasting:
...
case CL_INVALID_CONTEXT:
return "CL_INVALID_CONTEXT";
case CL_INVALID_QUEUE_PROPERTIES:
return "CL_INVALID_QUEUE_PROPERTIES";
case CL_INVALID_COMMAND_QUEUE:
return "CL_INVALID_COMMAND_QUEUE";
case CL_INVALID_HOST_PTR:
return "CL_INVALID_HOST_PTR";
...
Since I've recently started to use Vim, I am thinking there might be a way to do this in a more efficient way using Linux command tools and Vim. There was a similar post here where someone claimed to have done it with Emacs. Any ideas on how to avoid wasting 15 minutes with a similar task next time?
(I know that oclErrorSting() might exist but let's disregard that for generality's sake!)
You can do this in Vim with a search and replace:
%s/#define \(\w\+\).*/case \1:^M return "\1";/g
The trick to getting the ^M in the output is to type CTRL-V and then Enter where you want put a newline in the output.
This will do the replacement on the entire file.
This works by doing a seach which matches the entire line and replacing it with your desired text. Each name is captured into a group in the search, that's what the \(\w\+\) is doing, then the matched text is used twice in the replacement.
The other generic solution for repetitive tasks is to use macros, or complex repeats are they are called in help.
Basically you start recording your inputs in a register, create a single case, and then go to the next line of your define.
See :help q for more details.

Resources