MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Updaing the File thru JCL
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Mon Mar 03, 2003 7:56 am    Post subject: Updaing the File thru JCL Reply with quote

Hi,

I have got a Prod File where the Records got updated wrongly. We need a sample Job that can be used to rectify this.

Policy No Policy Code
11111111 ASDFRH
22222222 ASDFR H
33333333 FGHJKP L
55555555 HGJJJJPL

The Input File is ESDS with VB Format of Record Length 12911

We want to update the same file as below


11111111 ASDFRH
22222222 ASDFRH
33333333 FGHJKPL
55555555 HGJJJJPL

Thanks in Advance.

Rajeev
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Mon Mar 03, 2003 10:01 am    Post subject: Reply with quote

Rajeev,

If I understand correctly, all you need is to remove the space between the 2 and 3rd variable. Is that right??

If that is the case then, the following JCl will give your the desired results.A brief expalanation of the job. we first take in the input vsam file and split it into 3 files.We also add a seqnum of 8 bytes to the input file which we will later use to put back the file in the same order as the input file.

File T1 will have all the records which have a space in the second variable. ex:
Code:

22222222 ASDFR H


While writting these records we remove the space.

File T2 will have all the records which have a space in the second variable but at a diffferent position. ex:
Code:

33333333 FGHJKP L


While writting these records we remove the space.

File T3 will have all the normal records.

The next step takes in all these 3 temp file concatenated and sorts on the seqnum to get the original order of the input dataset and while writting the output removes the seqnum.
Code:

//STEP100 EXEC PGM=SORT               
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=YOUR ESDS VSAM FILE,
//           DISP=SHR
//T1      DD DSN=&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//T2      DD DSN=&T2,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//T3      DD DSN=&T3,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(X,Y),RLSE)
//SYSIN   DD *
  SORT FIELDS=COPY
  INREC FIELDS=(1,4,       $ RDW
                SEQ,8,ZD,  $ SEQNUM
                5)         $ THE ACTUAL RECORD
  OUTFIL FNAMES=T1,INCLUDE=(27,1,CH,EQ,C' '),
  OUTREC=(1,26,28)
  OUTFIL FNAMES=T2,INCLUDE=(28,1,CH,EQ,C' '),
  OUTREC=(1,27,29)
  OUTFIL FNAMES=T3,SAVE
//*
//STEP200 EXEC PGM=SORT               
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=&T1,DISP=OLD
//        DD DSN=&T2,DISP=OLD
//        DD DSN=&T3,DISP=OLD
//SORTOUT DD DSN=YOUR UPDATED ESDS FILE,
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=SYSDA,
//           SPACE=(CYL,(X,Y),RLSE)
//SYSIN   DD *
  SORT FIELDS=(5,8,ZD,A)
  OUTREC FIELDS=(1,4,13)
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Tue Mar 04, 2003 7:40 am    Post subject: Reply with quote

Kolusu,

Hope i have explained more clearly now.

Var-1 var-2 x(2) var-3 x(2)

------- ----------------- ------------------
11111111 RH
22222222 R H (Here it should have been ( RH ) in Var-2 not ( H ) in Var-3 but spaces)

Also can we update the same File Instead of creating a new File??

Thanks!!
Rajeev
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Mar 04, 2003 8:16 am    Post subject: Reply with quote

Rajeevvasudevan,


Yes it is possible to update the file instead of creating a new one.But it would require an exit to achieve that.If have DFSORT at your shop Frank will be able to help you with the exit.

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Tue Mar 04, 2003 8:50 am    Post subject: Reply with quote

Kolusu,

Here there is no DFSORT, we have got only SYNCSORT.

Thanks!!
Rajeev
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Mar 04, 2003 12:21 pm    Post subject: Reply with quote

Rajeev said "can we update the same File Instead of creating a new File??"

Kolusu said "Yes it is possible to update the file instead of creating a new one.But it would require an exit to achieve that.If have DFSORT at your shop Frank will be able to help you with the exit.

I'm reading Rajeev's request as "if I start with file 'a' as input, how do I end up with an updated version of file 'a', rather than file 'b'. To me, the answer to that question is, "use Kolusu's job with the SORTOUT of STEP200 pointing to your original data set". The original data set will then contain the updated records.

Kolusu, how are you interpreting this request and what would the exit do? (Are you interpreting the request as "how do I do all this in one pass?" or something else?).
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Mar 04, 2003 4:15 pm    Post subject: Reply with quote

Frank Yaeger,

Yes you are right on. I intrepreted that rajeev wanted all the update in just one pass of data. I assumed that he does not want any temporary files created in the between and use the same vsam file as input as well as output.

Btw if you haven't noticed the quote feature works fine with this bulletin board.for ex: Hilite any text in my post and just click on "quote selected" in the quick reply box and see what happens.

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Mar 04, 2003 4:19 pm    Post subject: Reply with quote

Kolusu,

Well, I guess Rajeev will have to tell us what he actually meant.

I've been burned by the quote feature on so many boards, that I'm really leery of using it. But I'll try to remember to give it a try next time I need to quote someone on this board.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Wed Mar 05, 2003 8:31 am    Post subject: Reply with quote

Hi,

Yeah i wanted to update the file in one pass ie the update has to be made in the Prod File with out creating any Temp Files.

Hope this will clear the things.

Thanks!!
Rajeev
Back to top
View user's profile Send private message Send e-mail
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Thu Mar 06, 2003 7:23 am    Post subject: Reply with quote

Hi,

I am getting this error while i am using the Sort. Could U pls let me know what could be this error??

WER231A INREC - ILLEGAL DATA FIELD

The Control Cards in the Sysin is

SORT FIELDS=COPY
INREC FIELDS=(1,4,SEQNUM,8,ZD,5)
OUTFIL FNAMES=T1,INCLUDE=(753,1,CH,EQ,C' '),
OUTREC=(1,752,754)
OUTFIL FNAMES=T2,INCLUDE=(755,1,CH,EQ,C' '),
OUTREC=(1,754,756)


Thanks!!
Rajeev
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Mar 06, 2003 7:40 am    Post subject: Reply with quote

Rajeevvasudevan,

I think you are having a very old version of syncsort which allows only 5 bytes for seqnum, so change your INREC to the following and see if it works.

Code:

INREC FIELDS=(1,4,SEQNUM,5,ZD,5)



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Thu Mar 06, 2003 7:49 am    Post subject: Reply with quote

Kolsu,

Still I am getting the same error. The Rel we are using is
RELEASE 3.7C BATCH 0312 TPF LEVEL 2A

Thanks!!
Rajeev
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Mar 06, 2003 4:14 pm    Post subject: Reply with quote

Rajeevvasudevan,

What is the Input file record format?? You will get an error
Code:

WER231A  INREC  - ILLEGAL DATA FIELD     


if you try the sysin cards you mentioned above. Post the entire sysout messages and I will take a look at it

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rajeevvasudevan
Beginner


Joined: 03 Dec 2002
Posts: 13
Topics: 3

PostPosted: Thu Mar 06, 2003 11:47 pm    Post subject: Reply with quote

Hi Kolsu,

I have taken the Listcat of the File and the below are the Charcteristics of the file.



FILE FORMAT -- = ENHANCED - FILE STATUS ----------- = LOADED
RECORD SIZE -- = 7822 - FREESPACE - CI% ------- = 0
CI SIZE ------ = 18432 - FREESPACE - CA% ------- = 0
BLOCK SIZE --- = 18452 - EXTENDED PE ----------- = 0
BLOCK FACTOR - = 3 - REQUESTED OVERFLOW ---- = 0
VAR OVERFLOW - = NO - EXTENDED OVERFLOW ----- = 0
FILE TYPE ---- = ESDS - EXTENDED ALLOCATED ---- = 0
DEVICE TYPE -- = 3390 - EXTENDED AVAILABLE ---- = 0
VOLUME COUNT - = 22 - SPACE USED ------------ = 43716
VOLSER ------- = HNO857 - SPACE ALLOCATED ------- = 24000
VOLSER ------- = HNO768 - SPACE ALLOCATED ------- = 15000
VOLSER ------- = HNO128 - SPACE ALLOCATED ------- = 4725
TOTAL EXTENTS = 9 - TOTAL SPACE ALLOCATED - = 43725
PRIMARY SPACE = 1000 - SECONDARY SPACE ------- = 200
PRIMARY SPACE = 1000 - SECONDARY SPACE ------- = 200 CYL
MULTIVOLUME -- = PRIMARY - MAX SECONDARY --------- = 1000 CYL
RELEASE ------ = NO - SHARE OPTIONS --------- = 2
DATA COMPRESS = ENABLED - INDEX COMPRESS -------- = YES
TOTAL RECORDS = 3881208 - INSERTS --------------- = 0
UPDATES ------ = 0 - DELETES --------------- = 0
HIGH USED RBA =4294950912 - HIGH ALLOCATED RBA ---- =2419924444
FILE DEFINED - = 2003.065 - 03/06/2003 - 4:15 AM - = 04:15:49
FILE LOADED -- = 2003.065 - 03/06/2003 - 4:26 AM - = 04:26:37
STORAGE REQUIRED FOR COMPRESSED PRIME INDEX -- = 305869
NUMBER OF IAM DATA BLOCKS -------------------- = 131100
EXTENDED HIGH ALLOCATED RBN ------------------ = 0

The Sysout Messages that i Recd during the sort is as Below.

WER164B 1,028K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,012K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=F ; LRECL= 7822; CISIZE = 18432
WER231A INREC - ILLEGAL DATA FIELD


Thanks&Regards,
Rajeev
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Fri Mar 07, 2003 12:48 am    Post subject: Reply with quote

Rajeev,

From the listcat messages I don't see any reference that the input file is a VARIABLE BLOCK file. But your sysout shows that RECFM is F(Fixed), so you need to specify the start and length of the fields.

Quote:

WER108I SORTIN : RECFM=F ; LRECL= 7822; CISIZE = 18432


So change your sysin cards for fixed files.

Hope this helps....

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group