|
View previous topic :: View next topic
|
| Author |
Message |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Hi all,
I am facing problem in inserting 10 spaces in a file (RECFM=VB). I tried to search for help on the net but could only find this: A helpful Tip from Bill Qualls - Assembler Guru.
Basically, I need to take the record from a VB file, insert spaces at a certain location and then write that record to a VB file. All this using SYNCSORT.
Details:
Input File Length: 504 (500 data + 4 RDW)
From this input file, I need to insert 10 spaces starting from 5th data position (i.e. 10th actual column) to 14th data position (i.e. 19th actual column). Luckily, the last 25 columns in the record is FILLER, so need not bother to increase the file length of the new output file. This FILLER region can be used. This modified record must be written to a file of the same record length of 504.
Output File Length: 504 (500 data + 4 RDW)
Input Record Sample:
| Code: |
RDW DATA(TILL 500)
----+----1----+----2----+----3----+----4
ABCDEFGHIJ.....
|
Output Record Sample:
| Code: |
RDW DATA(TILL 500)
----+----1----+----2----+----3----+----4
ABCDEXXXXXXXXXXFGHIJ...
|
Please do let me know if there are any alternatives to achieve this without using VTOF or FTOV. I need to take the VB file as input and create a VB file output.
Unfortunately, we don't use DFSORT for which I have a lot of documentation with me.
Thank you very much... |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| For what you need to do, I think that the DFSORT syntax will be almost if not exactly the same |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
Hello There ,
Please try this. I am not able to test it as i dont have syncsort currently
| Code: |
Sort fields=copy
outrec fields=(5,4,10X,16:9,490) |
Hope it should work |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Hi,
Here is my sort control card, please let me know where I have gone wrong.
| Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1:1,4,
5:5,4,
10:10X,
20:10,485)
|
The error that I get is as below:
| Code: |
WER108I SORTIN : RECFM=VB ; LRECL= 504; BLKSIZE= 27998
WER237I OUTREC RECORD LENGTH = 504
WER110I SORTOUT : RECFM=VB ; LRECL= 504; BLKSIZE= 27998
WER410B 7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,264K BYTES USED
WER244A OUTREC - SHORT RECORD
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
All the record lenghts are same, but it says OUTREC - SHORT RECORD |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
| Hi Ekta. I did go through the post, I am still confused. I tried using VLTEST=0, hoping that the records lengths will not be considered but still it gives me the same error which says that OUTREC - SHORT RECORD. I am not familiar with using the PARM options. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
In DFSORT, I usually use
| Code: |
Sort fields=copy
outrec fields=(5,4,10X,16:9) |
When it picks up the rest of the VB record. Maybe it may also work for SYNCSORT |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
Hello Balimanja,
Please try
| Code: |
| EXEC PGM=SORT,PARM='VLTESTI=2' |
Let us know the results. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
balimanja, You specified 10,485 in the OUTREC statement. This says that each record must be at least 500 bytes long. While the message WER244A, tells you that one or more of your variable-length records is not that long.
And what about 9th posistion, per your card?
I'm not connected just now -- but it seems you can work around by keeping these things in mind.
Just for try,You may use,
| Code: |
OUTREC BUILD=(1:1,4,
5:5,4,
10:10X,
20:20) |
This says that each record must be at least 16 (am I correct?) bytes long, which I suspect they are. |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Thanks Ekta & expat. It seems to be working. But there was one thing that I forgot to mention. This file has a header and trailer.
Header:
| Code: |
----+----1----+----2----+----3----+----4
H AL0909257563
|
Trailer:
| Code: |
----+----1----+----2----+----3----+----4
T 0909250000074508
|
The header lasts until 14th data column (19th actual column)
As I was trying your suggestions, I noticed that the code was working for only those columns that were within the header.
| Code: |
Sort fields=copy
outrec fields=(5,4,10X,16:9) |
The above code would work only until 15 (actual column) i.e.
| Code: |
Sort fields=copy
outrec fields=(5,4,10X,16:15) |
Beyond this, it would throw an error as I had mentioned above. I have a fair idea to byepass this and satisfy my above requirement of including spaces. But I can't think of doing it without using 3 steps associated with one invocation of SYNCTOOL & TOOLIN statements. Please let me know if there is any way in which I could do it more efficiently.
I will post the method along with the result soon.
Thank you all very much. |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Yes Anuj, I realised that the error was because of the header which was the shorter one... I am trying to find a way to byepass this problem i.e. exclude header and trailer while applying the logic that inserts spaces as per the requirement.
Thanks again...  |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Glad to hear that you figure it out... . And for this
| Quote: |
| exclude header and trailer while applying the logic that inserts spaces as per the requirement |
search the forum -- you may find multiple working examples in JCL and DFSORT/ICETOOL part of the forum. |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Hello everyone,
Here is what I have done so far.
| Code: |
OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'H'), <-HEADER
BUILD=(1,18)
OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'T'), <-TRAILER
BUILD=(1,22)
OUTFIL FNAMES=OUT3,INCLUDE=(5,1,CH,EQ,C'D'), <-OTHER TYPE REC
BUILD=(1:1,4,
5:5,118,
123:50X'FF',
173:123,6)
OUTFIL FNAMES=OUT4,SAVE, <-REMAINING DATA RECORDS
BUILD=(1:1,4,
5:5,38,
43:10X,
53:43,20,
73:10X,
83:63,20,
103:10X,
113:83,20,
133:10X,
143:103,20,
163:10X,
173:123,332)
|
Now I have split up the input records, inserted space in them (well it is a little different that what I had initially asked for .)
Here is the TOOLIN for the above CNTL.
| Code: |
COPY FROM(IN1) USING(LGC1)
|
Now that all the data are in separate files, I am stuck as to how to merge the Header, 'the Other Type Record', Data records and the Trailer (in the mentioned order). The Final file needs to be sorted as (2,13,CH,A).
Please let me know as to how to merge them together.
Header:
Trailer:
|
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
| Could it be done within the same SYNCTOOL step using another CNTL? I am sorry that I forgot to mention that. |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Thank you all for your help. I have been able to complete what was needed. A new learning since the file was a VB. Had it been a FB, I guess it wouldn't have caused that much of a problem...  |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| It would be nice, for the benefit of others, if you post the final solution you've used. |
|
| Back to top |
|
 |
balimanja
New User
Joined: 14 Aug 2007 Posts: 40 Location: Bangalore
|
|
|
|
Sorry for the delay since I had to put that into production. Here is what I did:
| Code: |
//TESTONE1 JOB (T),'MANJUNATH',CLASS=S,NOTIFY=&SYSUID,
// MSGCLASS=H
//**********************************************************************
//STEP010 EXEC PGM=IEFBR14
//DEL1 DD DSN=FILE.TEMP1,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//DEL2 DD DSN=FILE.TEMP2,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//DEL3 DD DSN=FILE.TEMP3,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//DEL4 DD DSN=FILE.TEMP4,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//DEL5 DD DSN=FILE.TEMP5,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//DEL6 DD DSN= FILE.FIXEDTHR,
// DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,0)
//**********************************************************************
//S020 EXEC PGM=SYNCTOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN1 DD DSN=INPUT.FILE,
// DISP=SHR
//OUT1 DD DSN=FILE.TEMP1,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//OUT2 DD DSN=FILE.TEMP2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//OUT3 DD DSN=FILE.TEMP3,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//OUT4 DD DSN=FILE.TEMP4,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//MERGE1 DD DSN=*.OUT3,
// VOL=REF=*.OUT3,
// DISP=(SHR,KEEP,KEEP)
// DD DSN=*.OUT4,
// VOL=REF=*.OUT4,
// DISP=(SHR,KEEP,KEEP)
//OUT5 DD DSN=FILE.TEMP5,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//MERGE2 DD DSN=*.OUT1,
// VOL=REF=*.OUT1,
// DISP=(SHR,KEEP,KEEP)
// DD DSN=*.OUT5,
// VOL=REF=*.OUT5,
// DISP=(SHR,KEEP,KEEP)
// DD DSN=*.OUT2,
// VOL=REF=*.OUT2,
// DISP=(SHR,KEEP,KEEP)
//OUT6 DD DSN=FILE.FIXEDTHR,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//TOOLIN DD *
COPY FROM(IN1) USING(LGC1)
SORT FROM(MERGE1) TO(OUT5) USING(LGC2)
COPY FROM(MERGE2) TO(OUT6) USING(LGC3)
//LGC1CNTL DD *
OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'H'),
BUILD=(1,18)
OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'T'),
BUILD=(1,22)
OUTFIL FNAMES=OUT3,INCLUDE=(5,1,CH,EQ,C'D'),
BUILD=(1:1,4,
5:5,118,
123:50X'FF',
173:123,6)
OUTFIL FNAMES=OUT4,SAVE,
BUILD=(1:1,4,
5:5,38,
43:10X,
53:43,20,
73:10X,
83:63,20,
103:10X,
113:83,20,
133:10X,
143:103,20,
163:10X,
173:123,332)
//LGC2CNTL DD *
SORT FIELDS=(6,13,CH,A,19,4,CH,A) <-This was some misc. req.
//LGC3CNTL DD *
SORT FIELDS=COPY
|
I hope it will be of use to someone.
Thank you all for your help. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|