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
 

 

S001 abend in reading/writing a file using structures.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 55
Location: Pune India

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

rohitcognizant

New User


Joined: 13 Feb 2007
Posts: 55
Location: Pune India

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

Site Director


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

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

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
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

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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