Print particular qualifier from a dataset to putput.
Print particular qualifier from a dataset to putput.
Hi,
I am looking forward to way to print a particular qualifier of a dataset into a separate file using sort JCL. If dataset is QUAL1.QUAL2.Dyymmdd, I want the yymmdd to be written in output. Please note I don't want D in the o/p.
Please suggest a way to do it.
I am looking forward to way to print a particular qualifier of a dataset into a separate file using sort JCL. If dataset is QUAL1.QUAL2.Dyymmdd, I want the yymmdd to be written in output. Please note I don't want D in the o/p.
Please suggest a way to do it.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Print particular qualifier from a dataset to putput.
You have the dataset name on a dataset, or are you thinking of the name of the DSN on SYSIN?
Re: Print particular qualifier from a dataset to putput.
Thanks for the reply.
I have file names in notepad so any of them I can opt for.
I have file names in notepad so any of them I can opt for.
Re: Print particular qualifier from a dataset to putput.
First get your file into a mainframe dataset.
Then run your sort program using that dataset as SORTIN.
Do a COPY operation.
INCLUDE only those records that you want.
BUILD the output using only the input columns that you want.
Then run your sort program using that dataset as SORTIN.
Do a COPY operation.
INCLUDE only those records that you want.
BUILD the output using only the input columns that you want.
Regards
Nic
Nic
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Print particular qualifier from a dataset to putput.
If you're talking then of qualifiers which may differ in length and number, there is a trick enrico has mentioned previously.
If you JFY with SHIFT=RIGHT for 1,44 then the last six positions will contain the date you want.
If you JFY with SHIFT=RIGHT for 1,44 then the last six positions will contain the date you want.
Re: Print particular qualifier from a dataset to putput.
Thanks all. but William which trick from enrico you are talking about here. Are you asking to look some other topic from him?
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Print particular qualifier from a dataset to putput.
The trick of coding what I suggested in the last line. If you slide everything to the right, the data you want is in a known position, no matter how many qualifiers or the lengths of them.
Re: Print particular qualifier from a dataset to putput.
Thanks. I did not think about this. But I stil ldon't see any post from enrico in this thread, perhaps you are mentioning about some other thread.William Collins wrote:The trick of coding what I suggested in the last line. If you slide everything to the right, the data you want is in a known position, no matter how many qualifiers or the lengths of them.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Print particular qualifier from a dataset to putput.
Yes, sorry, it is on another site, it is just that I remember enrico posting it. I'll find an example.
-
- Global Moderator
- Posts: 827
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Print particular qualifier from a dataset to putput.
I posted it somewhere else, but frankly I do not remember whereBut I stil ldon't see any post from enrico in this thread, perhaps you are mentioning about some other thread.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: Print particular qualifier from a dataset to putput.
Hit the enter too fast:
Thanks for the discussion around this. I was not able to login here for a while. If you can post what you have talked about I think many of us will get benefitted.
Thanks for the discussion around this. I was not able to login here for a while. If you can post what you have talked about I think many of us will get benefitted.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Print particular qualifier from a dataset to putput.
Here's an example:
It is the same principle for a low-level qualifier. If the qualifier is variable-length, it would require a PARSE also, after the data has been shifted. This can be a general way to find the "last", or a fixed-number of "fields" from the end of the record, when it is not known how many fields are on the record.
Code: Select all
//FIXPOS EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(51:7,44,JFY=(SHIFT=RIGHT))),
IFTHEN=(WHEN=INIT,
BUILD=(1,7,86,9))
//SORTIN DD *
KEY1 ! ABCDE 1111-1111
KEY1 ! ABCDE FGH 1111-1112
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute