rexx reading file data onto panel - panel

can you please suggest me the manual or example codes on how i can read the content of a file to be displayed in a rexx panel.
the number of lines from the file can vary and so cannot use the static manner.
thanks,
Samuel Mathews.

In ZOS to read the file in rexx use the execio command
i.e.
"EXECIO * DISKR myindd (STEM fileContentsVar."
Reads the file into a stem variable (fileContentsVar.0 holds the number of records and
fileContentsVar.1 ... hold the actual data).
You could store the file contents in a ISPF table and display the table using the
TBDispl command
The rexx code will be roughly
address ispexec
'tbcreate myfile names(line)'
do i=1 to fileContentsVar.0
line = fileContentsVar.i
'tbadd myfile'
end
'tbtop myfile'
'tbdispl mypanel'
'tbend myfile'
For an example of a table-panel definition see http://pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.f54dg00%2Fispzdg8040.htm
A table-panel would look like:
************************************************************
* )Attr *
* # Type(output) Intens(low) Just(asis) Caps(off) *
* )Body *
* -------------------- ????????????????? ----------------- *
* +Command ==>Cmdfld +Scroll ==>_samt+ *
* + *
* This table shows ... *
* *
* Line *
* )Model * ---- The model setion holds the
* #line + * Table display section
* *
* )Init *
* &samt=page *
* )Proc *
* )End *
************************************************************

Related

sed: replace part of line in text file at recognized character with entire line from another file

I have many sets of corresponding .txt files. I want to recognize a specific character ":" in the first .txt file (text1.txt) and then replace it (and the remainder of the line in text1.txt) with the corresponding line from the other .txt file (text2.txt). I would also like to add an additional character say "*" before the copied value.
text1.txt looks something like this:
*
10.04:60.429
*
*
*
12.023:60.078
*
9.033:60.045
*
9.023:60.062
*
*
and text2.txt looks something like this:
*
11
*
*
*
4
*
10
*
9
*
*
The output should look like this:
*
10.04*11
*
*
*
12.023*4
*
9.033*10
*
9.023*9
*
*
any ideas on the best way to do this with sed?
Below awk script should do
awk 'BEGIN{i=1;j=1}
NR==FNR{text1[i++]=$0;next}
/:/{gsub(/:[^:]*/,"*" text1[j],$0)}
#Note :[^:] looks for the last occurence of : in text1 strings
{j++}1' text2.txt text1.txt
Result
*
10.04*11
*
*
*
12.023*4
*
9.033*10
*
9.023*9
*
*

Create log file using crontab as different user not working [duplicate]

If I put the following in crontab -e:
* * * * * date +"%Y-%m-%d" > /home/apps/temp/env.txt
there is no env.txt created.
If I change the above line to:
* * * * * date > /home/apps/temp/env.txt
env.txt is created properly.
How can I format date in cron?
You need to escape each one of the %:
* * * * * date +"\%Y-\%m-\%d" > /home/apps/temp/env.txt
Or even better, remove the quotes and leave like this:
* * * * * date +\%Y-\%m-\%d > /home/apps/temp/env.txt

Ruby, Convert cron range into digit

Using Ruby
I would like that any ranges that appear in a cron to be expanded to the contained numbers in the range ex:
0,5,7,30-35 1,3-8,20 * * * /script.sh
expanded :
0,5,7,31,32,33,34,35 1,3,4,5,6,7,8,20 * * * /script.sh
Any help is appreciated
Assuming that 0,5,7,30-35 1,3-8,20 * * * /script.sh is a string, a simple gsub would work:
str = "0,5,7,30-35 1,3-8,20 * * * /script.sh"
str.gsub(/(\d+)-(\d+)/) { ($1..$2).to_a.join(',') }
#=> "0,5,7,30,31,32,33,34,35 1,3,4,5,6,7,8,20 * * * /script.sh"

Symfony 2.1 - Client side validation is only working for required contraint

As the assertions of Entities changed from MinLength and MaxLength to Length, Min and Max to Range, the validator guesser didn't follow these changes and the max_length attribute doesn't get filled, so HTML validation doesn't work for length.
I think there should be a new case for Symfony\Component\Validator\Constraints\Length in guessMaxLengthForConstraint function in Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser.php
Or is it a solved.
I'm using 2.1.6 but I tried 2.1.7 and there is no difference
Im using this:
/**
* #var float $height
*
* #ORM\Column(name="height", type="decimal", nullable=true)
*
*
* #Assert\Range(
* min = "20",
* max = "96",
* minMessage = "You must be at least 20 tall",
* maxMessage = "You cannot taller than 96"
* )
* #Assert\NotBlank(groups={"registration_step_two","profile_measurement"})
* #Assert\Regex(pattern= "/[0-9]/",message="Require number only")
* #Assert\MinLength(10)
*/
I added group validation to them and its finally work

How do I create a .p12 file in Ruby?

I've looked at the Ruby OpenSSL documentation, but I can't quite figure out the pieces I need to put together to make a .p12 file.
There's also this tutorial, but the comments belie an ambivalence about its correctness.
From ossl_pkcs12.c:
/*
* call-seq:
* PKCS12.create(pass, name, key, cert [, ca, [, key_pbe [, cert_pbe [, key_iter [, mac_iter [, keytype]]]]]])
*
* === Parameters
* * +pass+ - string
* * +name+ - A string describing the key.
* * +key+ - Any PKey.
* * +cert+ - A X509::Certificate.
* * * The public_key portion of the certificate must contain a valid public key.
* * * The not_before and not_after fields must be filled in.
* * +ca+ - An optional array of X509::Certificate's.
* * +key_pbe+ - string
* * +cert_pbe+ - string
* * +key_iter+ - integer
* * +mac_iter+ - integer
* * +keytype+ - An integer representing an MSIE specific extension.
*
* Any optional arguments may be supplied as nil to preserve the OpenSSL defaults.
*
* See the OpenSSL documentation for PKCS12_create().
*/
So (untested and probably incorrect - I am not very familiar with Ruby):
p12 = OpenSSL::PKCS12.create("password", "key", pkey, cert)
p12_bytes = p12.to_der

Resources