TSO - Insert blank page - sorting

Is there a way in TSO SORT to add a blank page after a certain string in the file ? Any help much appreciated. I need this extra page so that the output splits properly when being printed.

The SORT is being used in some JCL as below :-
//WSMFDST5 EXEC PGM=SORT,COND=(4,LT)
//SYSOUT DD SYSOUT=*
//SYSIN DD DSN=JLP.TEST.PARMLIB(WSMFD32C),DISP=SHR
//SORTIN DD DSN=WSM.TEMP.WSMPRM,DISP=(OLD)
//SORTOUT DD DSN=WSM.TEST.WSMPRM.WSMFF.GDG.NEW(0),DISP=(OLD,KEEP)
So, I was hoping to code something in JLP.TEST.PARMLIB(WSMFD32C)that adds a blank page when a certain string is found.
Many thanks

Related

How to grep columns and their ajoining rows of text from a .csv file then print in a specific pattern for zenity?

I asked this question once before but it was closed because it wasn't clear enough. I tried to edit it, but this website would not allow it. If the information below is still not clear enough, please do not close and give me the chance to fix it.
I have a .csv file that contains a lot of text. I want a bash script that will allow me to input a keyword, then print all columns/rows related to keyword in a zenity text box.
My code e.g.:
#!/bin/bash
path="filename.csv"
ans=$(zenity --entry --title="Keyword?" --timeout=10);
function () {
while IFS= read -r i; do echo "${i%?}"; done < "$path"|grep "$ans*"
}
function | zenity --list --title="Results" --text=function --multiple --separator=" " \
--column="tile-of-col1" --column="title-of-col2" --column="title-of-col3" --width 800 --height 200; exit;
What I expect:
title-of-col1 title-of-col2 title-of-col3
keyword info info on same row info on same row
What I get
title-of-col1 title-of-col2 title-of-col3
keyword,next column,next column keyword,next column,next column
Only the first column contains the keyword. I do have multiple instances where the keyword appears throughout the .csv but only in the first column
The question is, how can I get the text to print in a column/row format?
The code above is an example. The actual code does not use generic terms like function, but does contain sensitive information that I do not wish to share.
This is not a zenity issue. Even if I
cat filename.csv|grep keyword
the results are still
column-with-keyword,next-column-in-row-containing-keyword,next-column-in-row-containing-keyword
Basically, if my keyword is help*, all columns containing any variation of help would then be printed and joined by their row
help-me,go to help.com,some more info
help me please,absolutely not,go back to using pen and paper
I would like for it to look like in a zenity window
help-me go to help.web some more info
help me please absolutely not just use pen and paper
(those above statements are being said in a joking manner and not inteded to be taken serious)
I didn't quite understand your question.
If you have this CSV
a,b,c
help me please,absolutely not,go back to using pen and paper
lorem ipsum, sit lorem, arundary
help-me,go to help.com,some more info
you could use Miller to grep all records that contains help in every field, and create a pretty printed output in this way:
mlr --c2p grep 'help' input.csv
The output will be
a b c
help me please absolutely not go back to using pen and paper
help-me go to help.com some more info
If you do not want the header in the output, you can change the command in this way
mlr --c2p --headerless-csv-output grep 'help' input.csv

Convert the total amount in words

I'm converting my total amount into words using bi publisher. Btw, the amount is base on the data from the data set. Can someone help me what to do? Thanks
<?xdofx:to_check_number,sum(COLUMN_NAME, ‘EUR’, ‘CASE_UPPER’, ‘DECIMAL_STYLE_WORDS’)?>
I expect the output to be in words but the actual ouput is blank.
Use the function xdoxslt:toCheckNumber
Like this:
<?xdoxslt:toCheckNumber($_XDOLOCALE, sum(COLUMN_NAME), ‘EUR’, ‘CASE_UPPER’, ‘DECIMAL_STYLE_WORDS’)?>
For a detailed explanation, check this page. But bear in mind, this is an undocumented function.
In E-Business Suite r12, the XML file from the "out of the box" payments module has amount in text: OutboundPaymentInstruction/OutboundPayment/PaymentAmountText
<?xdofx:to_check_number(sum(COLUMN_NAME), 'EUR', 'CASE_UPPER', 'DECIMAL_STYLE_WORDS')?>
should work with fixed quotes and converted part ,sum(COLUMN_NAME,... into(sum(COLUMN_NAME),....
You can try this one which is working for my case.
<?xdoxslt:toWordsAmt(2300)?>
CASE_INIT_CAP

How can I create a list from a single url and append a numerical value to the end of every line

I need to provide a listing of a website's pages. The only thing to change per line is the page number at the end of the line. So for example, I need to take:
mywebsite.com/things/stuff/?q=content&page=1
And from that generate a sequential listing of pages:
mywebsite.com/things/stuff/?q=content&page=1
mywebsite.com/things/stuff/?q=content&page=2
mywebsite.com/things/stuff/?q=content&page=3
I need to list all pages between 1 - 120.
I have been using bash but any shell that gets the job done is fine. I don't have any code to show because I simply just don't know how to begin. It sounds simple enough but so far I'm completely at a loss as to how I can accomplish this.
With GNU bash 4:
printf '%s\n' 'mywebsite.com/things/stuff/?q=content&page='{1..120}
You can simply use:
for i in $(seq 120); do echo 'mywebsite.com/things/stuff/?q=content&page='"$i"; done > list.txt

How to solve INVALID DATA SET ATTRIBUTES using DFSORT?

I'm trying to pass a IBM file to hex values, so I coded this:
//R45ORF80V JOB (EFAS,2SGJ000),'LLAMI',NOTIFY=R45ORF80,
// MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,
// REGION=0M,TIME=5
//*---------------------------------------------------
//SORTEST EXEC PGM=ICEMAN
//SORTIN DD DSN=LF58.DFE.V1408001,DISP=SHR
//SORTOUT DD DSN=LF58.DFE.V1408001.OUT,
// DISP=(NEW,CATLG,DELETE),
// LRECL=1026,DATACLAS=CDMULTI
//SYSOUT DD SYSOUT=X
//SYSPRINT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,513,HEX)
END
/*
But I get the following error:
ICE043A INVALID DATA SET ATTRIBUTES: SORTOUT RECFM - REASON CODE IS 08
What am I dismissing? Anyway, the SYSIN is correct?
You cut off the most important part of the message, the message-code (I've edited into the question).
When you get a message out of DFSORT which you do not already recognize, you have a few choices: locate the manual DFSORT Messages, Codes and Diagnosis Guide for your release; use the IBM LookAT webservice (http://www-03.ibm.com/systems/z/os/zos/bkserv/lookat/); an internet search; ask your colleagues.
One of these should get you to:
ICE043A INVALID DATA SET ATTRIBUTES: ddname attribute
- REASON CODE IS rsn
Explanation: Critical. An error associated with a record format, record length or
block size was detected, or a conflict between these attributes was detected...
A Reason Code of 8 is:
Input and output data sets have mixed fixed length and variable length
record formats, or mixed valid and invalid record formats. Examples:
The SORTIN data set has RECFM=FB and the SORTOUT data set has
RECFM=VB. The SORTIN01 data set has RECFM=VB and the SORTOUT data set
has RECFM=F or RECFM=U
Basically it is as piet.t suspected in the comments, either your input is variable and output fixed (looks like you have something in the DATACLAS, is that the correct one?), or the other way around.
With SORT you do not need to supply any DCB information on the output dataset. That it, no RECFM, LRECL or BLKSIZE. Look at your SYSOUT. That will tell you the RECFM of your input dataset. If that is wrong, you are using the wrong file, or it has been created incorrectly. If it is correct, then strip all the DCB information off the output dataset.
If you still have problems after talking to your storage people about the DATACLAS, then paste the sysout from a current run of your JOB.
For the other issues you have, if you need help with those, start a new question.

How to copy only selected column of input file to output file in jcl sort

I am trying to copy data at position (50,10) of my input file to an output file,
but I am having problems.
My input file size is 100; the needed data is from the 50th position for next 10 bytes.
I have used the following options but each of them cause an abend.
I have taken output file as length 10 only, as I only need 10 bytes.
But abend says. OUTREC RECORD LENGTH = 10
SORTIN : RECFM=VB ; LRECL= 100; BLKSIZE= 1000
SORTIN : DSNAME=MNV.TESTS.DF.CPR810S1.EZ2OP
OUTREC RECORD LENGTH = 10
SORTOUT RECFM INCOMPATIBLE
SORTOUT : RECFM=FB ; LRECL= ; BLKSIZE=
I have used the below options:
OUTREC FIELDS(50,10)
SORT FIELDS(1,4,CH,A)
--------didn't work------------
SORT FIELDS=COPY
OUTREC FIELDS=(115,9,125,10)
--------didn't work------------
SORT FIELDS=COPY
BUILD=(50,10)
--------didn't work------------
INREC FIELDS=(50,10)
SORT FIELDS=(1,3,CH,A)
--------didn't work------------
I know it's pointless to mention that you rarely Accept or provide feedback, and are not that much of a voter either.
For some reason you cut them off, but all those messages you posted come with a WER prefix and a message number. If you consult your SyncSORT manual, you'll find all the messages documented.
Forget that for a moment. You have posted SORTOUT RECFM INCOMPATIBLE. Why go on about the record-length? The RECFM. The RECFM. You have included the text of the message which shows the RECFM of the SORTIN, and also the one which shows the RECFM of SORTOUT. They are VB and FB respectively. If you look at the message in the manual, you'll discover that you haven't done anything explicit to make them different.
You have two choices. VTOF or CONVERT. You can use them on OUTREC (I believe) and OUTFIL (for sure).
OPTION COPY
OUTFIL VTOF,
BUILD=(50,10)
Why you'd want to try SORTing the file, I don't know, and you should be aware by not that just making up syntax does not work.
For SORT, by default, the output file is the same RECFM as the input. A variable-length record must always contain an RDW, 1,4 and the data itself starts at position 5.
If you need an output file of a different RECFM, then you must be explicit about it (with CONVERT, FTOV or VTOF).
When creating an F record, no RDW, so your BUILD=(50,10) is the correct format (if you are four bytes out, remember that for a V record, data starts at position five, so you need to add four to all start-positions which don't take account of the RDW (like a COBOL record-layout).
When creating a V from an F, no RDW, the FTOV/CONVERT will create it.
With V input and V output, always specify (1,4 at the start of your BUILD statement.

Resources