Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is this code ok?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Reply to: Getting OUTREC error for the Varible Length File
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

Site Director


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

PostPosted: Wed Nov 04, 2009 9:17 pm    Post subject:
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    Post subject: Re: Reply to: Getting OUTREC error for the Varible Length Fi
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    Post subject: I did consider RDW
Reply with quote

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

DFSORT Moderator


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

PostPosted: Wed Nov 04, 2009 11:12 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Nov 04, 2009 11:30 pm    Post subject:
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)?
http://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: 1238
Location: Richfield, MN, USA

PostPosted: Wed Nov 04, 2009 11:34 pm    Post subject:
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    Post subject: Sorry
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

Site Director


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

PostPosted: Wed Nov 04, 2009 11:47 pm    Post subject:
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    Post subject: Sorry
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    Post subject: Solved!!
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 Moderator


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

PostPosted: Thu Nov 05, 2009 12:14 am    Post subject:
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    Post subject: Yeah
Reply with quote

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

Site Director


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

PostPosted: Thu Nov 05, 2009 12:31 am    Post subject: Reply to: Is this code ok?
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us