View previous topic :: View next topic
|
Author |
Message |
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
I need to delete a single record. So here is the description of the prob.
The PDS member contains more than 50,000 records, it's not fixed it can vary..but the dataset will contain huge number of records.
The data format is as below
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
now my requirement is after the member is created for the last record I need to delete the $ (ONLY THE LAST ONE ) using SYNCSORT. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Your post is very confusing...
are You dealing with a PDS ( partitioned dataset ) , or a PS
are You deleting a record, or are You simply reformatting the last record
the proper way to ask is to simply describe the problem/requirement
without specifying the tool
asking to do something with some <TOOL> implies that You have the competence
to evaluate the <TOOLS> available and make the <BEST> choice,
and You wouldn' t need to ask for help
please describe better Your requirements |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Sorry mistyped its a PS
Requirement:- I have created a Natural program for some BATCH PROCESSING.It reads a adabas file and writes a PS(Workfile).Now at the end of each record i have put $ as a seperator.Now this seperator will be written at the last record as well.
Since i do not want to do the changes to remove the last records $ seperator..because its called from other applications as well which needs a $ seperator at thier end.
So now i need to work this on the JCL.So what i need to do is to remove the $ seperator from the last record.
for example..my Program will write the records in below format in a workfile (PS)
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
{4: ABCDREKKKKKLLL -}..$
so for the last record i need to delete the $ seperator.
Please help
Thanks in ADVANCE |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Rather than waste a full pass of the data to "undo" the last delimiter, you could simply change the create program to write "one record behind".
Write the record with the $ ony when you know there is another. When the input is exausted, write the last record without the $. |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
That is what i mentioned earlier........i do not do the modifications in the module due to its multiple usage..and some other limitations
Please advice how we can do this using an JCL step. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i do not do the modifications in the module due to its multiple usage |
Suggest this would easily be handled by a parm that tells the code whether to write or not write the "last" $.
As happens often, there is a desire to implement what is easiest for the programmer - especially if someone else is to actually do the work/provide the code. . . |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Unless WHEN=LAST has been added to Syncsort/tool, I can only see a two pass sort with sequence numbers.
Possibly a copy pass to a DD DUMMY that generates a control input to another copy pass with sequence number that the IFTHEN can work on the last record. |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
CICS Guy wrote: |
Unless WHEN=LAST has been added to Syncsort/tool, I can only see a two pass sort with sequence numbers.
Possibly a copy pass to a DD DUMMY that generates a control input to another copy pass with sequence number that the IFTHEN can work on the last record. |
CICS GUY..can you please post a sample code for this.
Many thanks
Beruoist |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
can anyone help me on this please ?? |
|
Back to top |
|
|
maheshvamsi
New User
Joined: 22 Mar 2008 Posts: 39 Location: bangalore
|
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Help required
INPUT
Code: |
{4: ABCDREKKKKKLLLsdsd -}..$
{4: ABCDREKKKKKLLLasdadsdf -}..$
{4: ABCDREKKKKK -}..$
{4: ABCDREKKKKKasdasdqwrqrqwdLLL -}..$
{4: ABCDREKKKKKLadsasfefLL -}..$
|
OUTPUT
Code: |
{4: ABCDREKKKKKLLLsdsd -}..$
{4: ABCDREKKKKKLLLasdadsdf -}..$
{4: ABCDREKKKKK -}..$
{4: ABCDREKKKKKasdasdqwrqrqwdLLL -}..$
{4: ABCDREKKKKKLadsasfefLL -}..
|
Dollar at the last record needs to be removed,Please post the JCL code...i am very new to JCL |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Do not double post - the duplicate has been deleted.
If you had gone ahead and modified/written the code yesterday, you would be done now. . .
d |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
beruoist wrote: |
CICS GUY..can you please post a sample code for this. |
Did you look at maheshvamsi's How to remove the trailer record from the File?
Frank's first suggested code seems to be a good sample of how to do what you want. |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
what changes i wll require to do for my requirement in the below JCL code
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=T1,OVERLAY=(81:SEQNUM,8,ZD)
OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
TRAILER1=('LASTREC,+',COUNT=(M11,LENGTH=8),80:X)
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//OUT DD DSN=... output file (FB/80)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT,
OMIT=(81,8,ZD,EQ,LASTREC),
BUILD=(1,80)
/*
|
Please advice i am a noob in JCL
Thanks in advance
Beruoist |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What happened when you tried it for yourself ? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
beruoist wrote: |
what changes i wll require to do for my requirement in the below JCL code |
OK, if you knew that there was exactally five records in your file and each had a sequence number such as
Code: |
{4: ABCDREKKKKKLLL -}..$ 000000001
{4: ABCDREKKKKKLLL -}..$ 000000002
{4: ABCDREKKKKKLLL -}..$ 000000003
{4: ABCDREKKKKKLLL -}..$ 000000004
{4: ABCDREKKKKKLLL -}..$ 000000005 |
How would you modify the last record? Something like:
Code: |
IFTHEN=(WHEN=(cc,len,ZD,EQ,+000000005),OVERLAY=(cc:C' ')) |
Right? Then you would need another WHEN for everything else, right?
So a simple copy of the above data would get you what you want, right? |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
CICS Guy wrote: |
beruoist wrote: |
what changes i wll require to do for my requirement in the below JCL code |
OK, if you knew that there was exactally five records in your file and each had a sequence number such as
Code: |
{4: ABCDREKKKKKLLL -}..$ 000000001
{4: ABCDREKKKKKLLL -}..$ 000000002
{4: ABCDREKKKKKLLL -}..$ 000000003
{4: ABCDREKKKKKLLL -}..$ 000000004
{4: ABCDREKKKKKLLL -}..$ 000000005 |
How would you modify the last record? Something like:
Code: |
IFTHEN=(WHEN=(cc,len,ZD,EQ,+000000005),OVERLAY=(cc:C' ')) |
Right? Then you would need another WHEN for everything else, right?
So a simple copy of the above data would get you what you want, right? |
my will always contain 50000+ or 50000- records ...the number of records arent fixed.In that case how we will find and modify the last record.
Complete JCL will be very helpful.
Thank you very much |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
Complete JCL will be very helpful. |
I am not going to write this, I'm trying to show you how to get what you want. You need to do the writing.
Try it, you may learn something. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Still "fritterin'" away time to implement something that requires a complete copy of the entire file. . .
Gee, just like is done on the Winboxes that have so many performance problems. . .
Rather pathetic - but probably good for cpu and dasd sales. . .
d |
|
Back to top |
|
|
|