View previous topic :: View next topic
|
Author |
Message |
rohitcognizant
New User
Joined: 13 Feb 2007 Posts: 54 Location: Pune India
|
|
|
|
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 |
|
|
rohitcognizant
New User
Joined: 13 Feb 2007 Posts: 54 Location: Pune India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
|