View previous topic :: View next topic
|
Author |
Message |
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
Guys,
Is this code all right?
// SYSIN DD*
SORT FIELDS=COPY
INCLUDE COND=(531,2,PD,EQ,636)
OUTREC FIELDS=(1,4,531,2,C';',211,2)
/*
The reason I am asking is that this code has been running for a long time but I haven't got an answer.
I am trying to select only those records whose field (from position 531 to 532) equals 636 and want only two fields in the output record. The input is variable length.
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When you have a question, start a new topic for your question rather than posting a reply to an unrelated topic that has been inactive for 2 years. . .
Your "rules" are incorrect - there is no way to "equals 636" "from position 531 to 532". You need to post accurate/implementable rules. Oops - my bad - missed the PD. And thanks to DBZ for the reminder
You need to post some sample input and the output you want from that input. You can use 80 byte sample data and adjust for the real requirement whan you know how to implement.
Mention the lrecl and recfm of both files. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
souryab wrote: |
Guys,
Is this code all right?
The reason I am asking is that this code has been running for a long time but I haven't got an answer.
I am trying to select only those records whose field (from position 531 to 532) equals 636 and want only two fields in the output record. The input is variable length.
Regards, |
if the input is variable length did you consider the RDW? The first 4 bytes consists of the RDW and your actual data starts at pos 5.
Assuming that you did NOT consider the rdw , here are the modified control cards
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(535,2,PD,EQ,636)
OUTREC FIELDS=(1,4,535,2,C';',215,2)
/* |
|
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
Unfortunately or fortunately, I did consider RDW. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
souryab,
I don't know what you mean by "is this code all right?". It depends on what your data looks like and what you're trying to do - none of which you've explained.
If the data in positions 531-532 is PD, then it will not be displayable so using 531,2 in OUTREC doesn't make a lot of sense unless you don't need to actually display the data in readable format.
But other than that, I can't tell you if the code is all right without knowing more. |
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
Frank,
I mean the code is not right since its abending with S913.
I want to know where the error is.
I am trying to select only those records from an input file where the field (531-532) value is equal to 636. Then in the output file, I want only that field and another field (211,212) to be included. I have added 4 to the positions as per the FileAid layout because the input's variable length.
Question: How do I display the PD? By converting to ZD?
Can you please let me know the code?
Regards,
Sourya. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
souryab wrote: |
Frank,
I mean the code is not right since its abending with S913.
I want to know where the error is.
I am trying to select only those records from an input file where the field (531-532) value is equal to 636. Then in the output file, I want only that field and another field (211,212) to be included. I have added 4 to the positions as per the FileAid layout because the input's variable length.
Question: How do I display the PD? By converting to ZD?
Can you please let me know the code?
Regards,
Sourya. |
Would it have killed you to mention the S913 in your original post or in your Topic title? Have you looked up that msg in the MVS System Codes manual? |
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
Sorry, I think mentioned it in a PM to Frank when he pointed out I should have started a new topic instead of posting in a new thread...I maybe close to a solution...I think there was something wrong in the layout I was using...the variables would be shifted by 1.
Like all major goof-ups, I think this too has a simple explanation...as for the display of PD in file, I think TO=ZD will work, right?
Am running a test now.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is best to post technical discussion in the forum rather than via PM (unless requested to do otherwise).
If part of the dialog is done via PM, the rest of the forum cannot benefit.
It is also extermely important to mention an abend or other error in the original post. |
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
I apologize.
I am quite new here.
I will be more careful in future.
Sourya. |
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
I have solved the issue. Thanks everyone for your help!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I think it was Dick who asked you to start a new thread.
Quote: |
as for the display of PD in file, I think TO=ZD will work, right? |
That depends on whether the PD values can be negative.
I would think that M25 or M26 would be better, but it depends on what you want the displayed values to look like (signed or unsigned, leading zeros shown or suppressed, etc). |
|
Back to top |
|
|
souryab
New User
Joined: 23 May 2007 Posts: 10 Location: India
|
|
|
|
Right, it was Dick. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thanks for letting us know
Quote: |
I apologize.
I am quite new here.
I will be more careful in future. |
Not to worry - we were all new here at some time and had to learn. . .
If you post the code that works, it will probably help someone else with a similar problem later.
d |
|
Back to top |
|
|
|