View previous topic :: View next topic
|
Author |
Message |
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
I am trying to add about 57 members to a PDS using the LM functions. I have allocated the PDS outside REXX and using the rexx routine to add different members to the PDS. The data to be stored in each member is coming from another PS file. However after processing correctly about 4 members correctly, the REXX is failing with "Unrecognized I/O error during write"
Logic flow is as follows:
Allocate the PS file
Read the PS file
LMINIT PDS
LMOPEN DATAID OUTPUT
for all records of PS file
LMADD member1
Allocate Fil1 for member1
Queue a few lines (based on criteria)
write form queue
(repeat above steps into member2, member3.... till end of PS file)
LMCLOSE PDS
LMCOMP PDS
LMFREE PDS
Questions are
Why I am facing the errror?
Why is this error coming after processing some records correctly?
Is this due to trying to add too many members?
What is the workaround?
PDS allocated with 20 Pri 20 Sec 20 Dir Blks LRECL 80
If I increase allocation to 50 50 50 the number of members processed goes upto 8. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Give the full allocate statement, 50 50 50 is totally meaningless, other than the fact that is probably means a max of 800 blocks of potentially 1 record, i.e. a total of 800 records... |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Please note that I am allocating the PDS fropm ISPF not thru REXX. By 50 50 50 I meant 50 Pri, 50 Sec and 50 Dir blk size |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
As I already wrote, 50, 50, 50 is totally meaningless. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
LMADD ? That command doesnt exist.
The normal sequence to create a member is to fill it with LMPUT and
after that to issue a LMMADD. |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
I understand that whatever I have put as the logic just represents the flow. It may not be syntactically correct since I just want to represent the flow of the REXX routine. I am aware LMADD is actually LMMADD and is preceded by LMPUT.
But I am more interested in knowing why I am getting an Unrecognised I/O error. Is it because of space as in am I facing a space Abend? If so what is the work around? I need to add about 57 members to this PDS and the process is getting terminated after processing certain nos. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you pre-allocate a much larger pds.
Then insert members in your process. . . |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
What I don't get is, wouldn't an x37 type of error show up on the terminal at some point? Anyway, maybe it would be better to just build an IEBUPDT-ready dataset and when ready, run IEBUPDT. At least then it would be easy to see any errors and to easily fix them. |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Hey d.sch I did try with a pre-allocated PDS of 100 100 50. It increased the no of members processed to 10 only. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Hey d.sch I did try with a pre-allocated PDS of 100 100 50. |
As has been mentioned, nn nn nn tells us nothing. . . Are these cylindars, tracks, blocks. . .
If you look at the info for the dataset, what does this show (for space, lrecl, etc)? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
sandy257 wrote: |
I understand that whatever I have put as the logic just represents the flow. It may not be syntactically correct since I just want to represent the flow of the REXX routine. I am aware LMADD is actually LMMADD and is preceded by LMPUT.
But I am more interested in knowing why I am getting an Unrecognised I/O error. Is it because of space as in am I facing a space Abend? If so what is the work around? I need to add about 57 members to this PDS and the process is getting terminated after processing certain nos. |
Your logic/flow as described stinks. It would be better if you show us the actual code. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Just telling what You are doing will not help to diagnose errors!
You have got to post the real code!
as a general concern it is a bad thing to mix up <technologies>
You have started with the LM***** stuff stay with it, use LMPUT to write records
but since you have given us nothing to work with, very little we can do for help
post the code, the dataset allocation info, dataset DCB above all |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Use PROFILE MSGID
and show us any messages you get. Also look in syslog for messages. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What the hell does this mean pedro?
The TS doesnt know to find his hands sitting on them. Or something like that. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
sandy257 wrote: |
Please note that I am allocating the PDS from ISPF not thru REXX. By 50 50 50 I meant 50 Pri, 50 Sec and 50 Dir blk size |
As prino said already twice, this means nothing, as long as we don't know if it's 50 cylinders, 50 tracks or 50 blocks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
And while you reply with the space clarification, you should also mention how many records are to be loaded. . . |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Extremely sorry for missing out on such a critical piece of information. All allocations mentioned are in CYLS.
I cannot copy paste the code as I am restricted wrt the policies. But will try to put a better representation of the code |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Records to be loaded are approximately 6500.. to be distributed over 57 members. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
we are all wasting time here, if You cannot post Your frigging code,
do not ask on a public forum
solve Your issues inside Your organization...
all You are telling is...
You are allocating something
You do something...
You get some error
do a bit of intelligent thinking please...
how in h*** are we supposed to find out what is wrong there |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Allocated PDS "DSN.PDS" with CYL(100,100) Dir Blk 50 FB LRECL 80
data in DS DSN1 - PS, FB LRECL 133, approximately contains 6500 rows
Objective: To distribute the 6500 rows from DSN1 into 57 members to be stored into DSN.PDS
Code is as follows:
Code: |
-------------------------------------------------
/* REXX */
ADDRESS TSO
"ALLOC F(INFILE) DA('DSN1') SHR"
"EXECIO * DISKR INFILE STEM(IN_REC. FINIS"
K = 1
ADDRESS ISPEXEC
"LMINIT DATASET('DSN.PDS') DATAID("D") ENQ(EXCLU)"
"LMOPEN DATAID("D") OPTION(OUTPUT)"
DO I=1 TO IN_REC.0
IF POS('*01 COPY IDMS',IN_REC.I) > 0 THEN
DO
FSTLN = STRIP(SUBSTR(IN_REC.I,51,20))
PARSE VAR FSTLN COPYBKNM '-' RECLIT
COPYBKNM = STRIP(COPYBKNM)
IF I > 1
DO
ADDRESS TSO
LINES = QUEUED()
"EXECIO " LINES " DISKW COPYF"K
"EXECIO 0 DISKW COPYF"K" (FINIS"
DELSTACK
K = K + 1
END
ADDRESS ISPEXEC
"LMPUT DATAID("D") MODE(INVAR) DATALOC(DATAVAR) DATALEN(80)"
"LMMADD DATAID("D") MEMBER("COPYBKNM") STATS(NO)"
ADDRESS TSO
"ALLOC FI(COPYF"K") DSN('DSN.PDS("COPYBKNM")') SHR REU"
END
ELSE
DO
VAL1 = SUBSTR(IN_REC.I,19,80)
ADDRESS TSO
QUEUE VAL1
END
"EXECIO 0 DISKW INFILE (FINIS"
"FREE F(INFILE)"
ADDRESS ISPEXEC
"LMCLOSE DATAID("D")"
"LMFREE DATAID("D")"
SAY "COPYBOOK GENERATION SUCCESSFUL"
EXIT |
-------------------------------------------------
Please note I had to type out the code from the screen (could not copy paste). If there is a typo that makes it syntactically incorrect please correct the same and proceed (my code does not have any syntax errors as this is working if I use a smaller DS with 100 records).
Please let me know in case u need further information. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Dir Blk 50
how many members do you think can be added to your pds?
OR
how many members do you think your pds can contain? |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
Sorry.. max dir blks is 100 |
|
Back to top |
|
|
sandy257
New User
Joined: 03 Feb 2010 Posts: 19 Location: Pune
|
|
|
|
I think the max number of members that can be contained in my PDS is 600? Even if the dir blk size is 50; I think it wiuld have accomodated 300 members. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
And while you reply with the space clarification, you should also mention how many records are to be loaded. . . |
The allocation information has still not been posted. . .
The best way to get help is to provide requested info on the first request - not the third request.
Suggest you become comfortable with the "Code" tag - this will preserve alignment and inprove readability.
With the tso/ispf editor (not some code), try to create 100 members in your pds and tell us what happens. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
still I do not see any need to clobber the script with the LM**** stuff!
the simple flow should be ...
allocate and read the input file
process each record stacking something
when some flag tells
allocate write close free the output dataset
after loop termination
if a dataset write is pending just
allocate write close free the output dataset for the last unprocessed chunk
no need to bother ISPF.
nor to change the DDNAME for the output. |
|
Back to top |
|
|
|