Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
S001 abend in reading/writing a file using structures.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
rohitcognizant

Active User


Joined: 13 Feb 2007
Posts: 54
Location: chennai

PostPosted: Thu Jun 14, 2007 2:39 pm    Post subject: structure declarationa and appending a file - S001 abend
Reply with quote

I have to declare 4 structures , populate them by reading from a file and write them into a file.
I have tried the following method.
I get a system abend S001 when i run this.
Please do help me out.

PGM9:PROC OPTIONS(MAIN);
DCL SORT1 FILE INPUT RECORD;
DCL SORT FILE UPDATE RECORD;

DCL 1 STRUCT1,
2 NUM1 PIC '999' INIT(123),
2 UNSD1 CHAR(77);
DCL 1 STRUCT2,
2 NUM1 PIC '999' INIT(456),
2 UNSD1 CHAR(77);
DCL 1 STRUCT3,
2 NUM1 PIC '999' INIT(789),
2 UNSD1 CHAR(77);
DCL 1 STRUCT4,
2 NUM1 PIC '999' INIT(000),
2 UNSD1 CHAR(77);


OPEN FILE(SORT1);
OPEN FILE(SORT);

READ FILE(SORT1) INTO(STRUCT1);
PUT SKIP LIST(STRUCT1);
WRITE FILE(SORT) FROM(STRUCT1);
WRITE FILE(SORT) FROM(STRUCT2);
WRITE FILE(SORT) FROM(STRUCT3);
WRITE FILE(SORT) FROM(STRUCT4);*/

CLOSE FILE(SORT1);
CLOSE FILE(SORT);

END PGM9; [/img][/quote]
Back to top
View user's profile Send private message
References
PostPosted: Thu Jun 14, 2007 2:39 pm    Post subject: Re: structure declarationa and appending a file - S001 abend Reply with quote

rohitcognizant

Active User


Joined: 13 Feb 2007
Posts: 54
Location: chennai

PostPosted: Thu Jun 14, 2007 2:42 pm    Post subject: S001 abend in reading/writing a file using structures.
Reply with quote

I tried to read from a file and populate it into the following structure and then write the same into a new file.
I get a system abend when i run this.
What could be the problem?
Is there anything wrong with the fixed dec declaration?


PGM9:PROC OPTIONS(MAIN);
DCL SORT1 FILE INPUT RECORD;
DCL SORT FILE UPDATE RECORD;

DCL 1 STRUCT1,
2 NUM1 fixed dec(3),
2 UNSD1 CHAR(77);


OPEN FILE(SORT1);
OPEN FILE(SORT);

READ FILE(SORT1) INTO(STRUCT1);
PUT SKIP LIST(STRUCT1);
WRITE FILE(SORT) FROM(STRUCT1);


CLOSE FILE(SORT1);
CLOSE FILE(SORT);

END PGM9;
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8022
Location: 221 B Baker St

PostPosted: Thu Jun 14, 2007 11:50 pm    Post subject:
Reply with quote

Hello,

Please post the jcl from the abended run as well as the actual diagnostic info that will be in the jes output.
Back to top
View user's profile Send private message
Bitneuker

IMS Moderator


Joined: 07 Nov 2005
Posts: 1143
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 18, 2007 5:11 pm    Post subject:
Reply with quote

Why are you using structures if you simply want to copy the inputfile? Usually one programs:
Code:

DCL INP_REC CHAR(80);
DCL 1 INP_STRUC BASED(ADDR(INP_REC)),
       3 KEYFIELD PIC'999',
       3 FILLER CHAR(77);

READ FILE(INP_FILE) INTO (INP_REC);


And why is your outputfile declared as UPDATE?

Why do you not use a utility like IEBGENER or IDCAMS to duplicate a file?
Back to top
View user's profile Send private message
Bitneuker

IMS Moderator


Joined: 07 Nov 2005
Posts: 1143
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 18, 2007 5:13 pm    Post subject:
Reply with quote

And as Dick wrote: post all your info so we may find out which file is in failure; you've got 3 sort, sort1 and sysout.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1