How to solve INVALID DATA SET ATTRIBUTES using DFSORT? - 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.

Related

Where does values of argument `timestamp` of quantstrat::ruleSignal's come from?

When reading source code of ruleSignal, argument timestamp at line 66 is a very important input, but I could not figure out where timestamp data come from.
It seems that functions add.indicator, add.signal, add.rule, applyIndicators, applySignals, which run before ruleSignal don't use or generate timestamps values.
I wonder which function generates values of timestamp for ruleSignal to use, or where data of timestamp come from.
Thanks a lot!
Thanks to Brian Peterson's reply which answers my question:
indicators and signals are always presumed to be vectorized, per the
documentation, so no timestamp is required.
rules, by default, are path dependent, and thus need a timestamp to
operate from.
The path-dependent loop is outside of the individual rule function.
see line 555 of rules.R

MATLAB ConnectedComponentLabeler does not work in for loop

I am trying to get a set of binary images' eccentricity and solidity values using the regionprops function. I obtain the label matrix using the vision.ConnectedComponentLabeler function.
This is the code I have so far:
files = getFiles('images');
ecc = zeros(length(files)); %eccentricity values
sol = zeros(length(files)); %solidity values
ccl = vision.ConnectedComponentLabeler;
for i=1:length(files)
I = imread(files{i});
[L NUM] = step(ccl, I);
for j=1:NUM
L = changem(L==j, 1, j); %*
end
stats = regionprops(L, 'all');
ecc(i) = stats.Eccentricity;
sol(i) = stats.Solidity;
end
However, when I run this, I get an error says indicating the line marked with *:
Error using ConnectedComponentLabeler/step
Variable-size input signals are not supported when the OutputDataType property is set to 'Automatic'.'
I do not understand what MATLAB is talking about and I do not have any idea about how to get rid of it.
Edit
I have returned back to bwlabel function and have no problems now.
The error is a bit hard to understand, but I can explain what exactly it means. When you use the CVST Connected Components Labeller, it assumes that all of your images that you're going to use with the function are all the same size. That error happens because it looks like the images aren't... hence the notion about "Variable-size input signals".
The "Automatic" property means that the output data type of the images are automatic, meaning that you don't have to worry about whether the data type of the output is uint8, uint16, etc. If you want to remove this error, you need to manually set the output data type of the images produced by this labeller, or the OutputDataType property to be static. Hopefully, the images in the directory you're reading are all the same data type, so override this field to be a data type that this function accepts. The available types are uint8, uint16 and uint32. Therefore, assuming your images were uint8 for example, do this before you run your loop:
ccl = vision.ConnectedComponentLabeler;
ccl.OutputDataType = 'uint8';
Now run your code, and it should work. Bear in mind that the input needs to be logical for this to have any meaningful output.
Minor comment
Why are you using the CVST Connected Component Labeller when the Image Processing Toolbox bwlabel function works exactly the same way? As you are using regionprops, you have access to the Image Processing Toolbox, so this should be available to you. It's much simpler to use and requires no setup: http://www.mathworks.com/help/images/ref/bwlabel.html

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.

Bestw.d format syntax in SAS

I am converting a character variable to a numeric variable. I am using a bestw.d format. I also tried just best. as the format in the input statement and this worked fine. I cant find any mention of just using best. instead of bestw. in SAS help, though I know from SAS help that the d can be omitted. I have been playing around with using just the best.and I am wondering if there is a default w assigned when just using best..
All formats have a default w. It is not generally good practice to use best. (or <format>.) in most cases, as you should know and plan for the specific width needed, but it always exists.
Also, informat and format have different defaults in many cases where there are identically named informat and format.
In the case of bestw., the default length is 12. See this documentation page for details.
I always find it's worth using a worked example, this shows the different outcomes when using lengths on the BEST. format:
data _NULL_;
a=1031564321300.302;
put '==================================';
put 'Different "BEST" formats';
put '==================================';
put 'BEST8. - ' a best8.;
put 'BEST12. - ' a best12.;
put 'BEST13. - ' a best13.;
put '==================================';
put 'BEST. - ' a best.;
put '==================================';
run;
You can run this in your environment and check the outcome. On my machine it looks like this:
==================================
Different "BEST" formats
==================================
BEST8. - 1.032E12
BEST12. - 1.0315643E12
BEST13. - 1031564321300
==================================
BEST. - 1.0315643E12
==================================
i.e. It looks like BEST12. is the matching format when no width is specified.

Pass data from workspace to a function

I created a GUI and used uiimport to import a dataset into matlab workspace, I would like to pass this imported data to another function in matlab...How do I pass this imported dataset into another function....I tried doing diz...but it couldnt pick diz....it doesnt pick the data on the matlab workspace....any ideas??
[file_input, pathname] = uigetfile( ...
{'*.txt', 'Text (*.txt)'; ...
'*.xls', 'Excel (*.xls)'; ...
'*.*', 'All Files (*.*)'}, ...
'Select files');
uiimport(file_input);
M = dlmread(file_input);
X = freed(M);
I think that you need to assign the result of this statement:
uiimport(file_input);
to a variable, like this
dataset = uiimport(file_input);
and then pass that to your next function:
M = dlmread(dataset);
This is a very basic feature of Matlab, which suggests to me that you would find it valuable to read some of the on-line help and some of the documentation for Matlab. When you've done that you'll probably find neater and quicker ways of doing this.
EDIT: Well, #Tim, if all else fails RTFM. So I did, and my previous answer is incorrect. What you need to pass to dlmread is the name of the file to read. So, you either use uiimport or dlmread to read the file, but not both. Which one you use depends on what you are trying to do and on the format of the input file. So, go RTFM and I'll do the same. If you are still having trouble, update your question and provide details of the contents of the file.
In your script you have three ways to read the file. Choose one on them depending on your file format. But first I would combine file name with the path:
file_input = fullfile(pathname,file_input);
I wouldn't use UIIMPORT in a script, since user can change way to read the data, and variable name depends on file name and user.
With DLMREAD you can only read numerical data from the file. You can also skip some number of rows or columns with
M = dlmread(file_input,'\t',1,1);
skipping the first row and one column on the left.
Or you can define a range in kind of Excel style. See the DLMREAD documentation for more details.
The filename you pass to DLMREAD must be a string. Don't pass a file handle or any data. You will get "Filename must be a string", if it's not a string. Easy.
FREAD reads data from a binary file. See the documentation if you really have to do it.
There are many other functions to read the data from file. If you still have problems, show us an example of your file format, so we can suggest the best way to read it.

Resources