IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is this code ok?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Wed Nov 04, 2009 8:11 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 04, 2009 9:17 pm
Reply with quote

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 icon_smile.gif

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 04, 2009 10:03 pm
Reply with quote

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
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Wed Nov 04, 2009 10:06 pm
Reply with quote

Unfortunately or fortunately, I did consider RDW.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 04, 2009 11:12 pm
Reply with quote

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
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Wed Nov 04, 2009 11:25 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 04, 2009 11:30 pm
Reply with quote

Hello,

You need to post the jcl/control statements as well as the actual abend message.

It may also help if you post the informational messages produced by the sort.

Did you look up the s913 info (IEC150I)?
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/iea2m791/3.78
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Nov 04, 2009 11:34 pm
Reply with quote

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? icon_evil.gif Have you looked up that msg in the MVS System Codes manual?
Back to top
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Wed Nov 04, 2009 11:38 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 04, 2009 11:47 pm
Reply with quote

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
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Wed Nov 04, 2009 11:48 pm
Reply with quote

I apologize.
I am quite new here.
I will be more careful in future.

Sourya.
Back to top
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Thu Nov 05, 2009 12:14 am
Reply with quote

I have solved the issue. Thanks everyone for your help!!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 05, 2009 12:14 am
Reply with quote

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
View user's profile Send private message
souryab

New User


Joined: 23 May 2007
Posts: 10
Location: India

PostPosted: Thu Nov 05, 2009 12:22 am
Reply with quote

Right, it was Dick.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 05, 2009 12:31 am
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

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. . . icon_wink.gif

If you post the code that works, it will probably help someone else with a similar problem later.

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top