Posted: Wed Jun 01, 2005 6:13 pm Post subject: Easytrieve - close a file
hi
please let me know how I can close a file that I opened in Easytrieve
i have a program ( input1, input2 are input files )
job input input1
get input2
do while not eof input2
*****
*****
get input2
end-do
once the input2 eof is reached I get an error as we try to open it for the next record of input1,
can somebody suggest how to close input2 once eof is reached
thanks in advance _________________ champion is not one who never fails, but one who never quits
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Jun 02, 2005 11:22 am Post subject:
Quote:
I dont want to stop processing at end of file Input2,
I want to read second record of input1 and start reading input2 from the start, any help on this
Bullfighter,
What exactly are you trying to do ? Are you trying to compare every record from file 1 with all the records of file 2? Post detailed information on what you're trying to accomplish. May be we can suggest a better way.
Quote:
what is synchronised file processing ?? can you give me more info
Easytrieve's Synchronized File Processing (SFP) facility can be used with one file or multiple files. It can be used to perform match/merge operations on multiple files.
yes I am trying to compare every record of file 1 with all records of file2
File1 and file2 are entirely different formats
File1:
12345678912345678911
12345678812345678911
File2
TRAN....*.<TADP 0...
TRAN....*.<TADP 1...
My requirement :
1. Pick first 9 characters of file1
2. check every record in file2, to see if the value from position 5 until 5 places is same as the one from file1 ( value from file1 is char9, value from file2 is packed5 )
3. once we check all the records in file2 , start with next record of file1
Is this clear,
please let me know if this is not,
please help me in this
thanks a lot _________________ champion is not one who never fails, but one who never quits
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Jun 02, 2005 11:57 am Post subject:
Quote:
2. check every record in file2, to see if the value from position 5 until 5 places is same as the one from file1 ( value from file1 is char9, value from file2 is packed5 )
Bullfighter,
What do you want to do if the value matches ? write it to an output file?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Jun 02, 2005 12:10 pm Post subject:
Bullfighter,
Step1 : Sort the file1 on the first 9 bytes. If you have duplicates eliminate them.
Code:
//SYSIN DD *
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE
/*
STEP2 : sort the file2 on the packed decimal field expanding it as character.If you have duplicates eliminate them. Also use a Include condition to include only records with 'ADP' at pos 14.
Code:
//SYSIN DD *
INCLUDE COND=(14,3,CH,EQ,C'ADP')
INREC FIELDS=(5,5,PD,EDIT=(TTTTTTTTT)
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE
/*
step2 I am getting error an error, can you help me
my OUTREC should have the Packed numbers + another 11 characters starting at 106, so I changed it accordingly and I am getting the below error
SYSIN :
INCLUDE COND=(53,3,CH,EQ,C'ADP')
INREC FIELDS=(5,5,PD,EDIT=(TTTTTTTTT),106,11)
SORT FIELDS=(1,20,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1,20)
WER164B 12,672K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,008K BYTES USED
WER146B 16K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VB ; LRECL= 1008; BLKSIZE= 27998
WER235A INREC RDW NOT INCLUDED
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE _________________ champion is not one who never fails, but one who never quits
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum