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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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