IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy a VB file of length 446 to VB file of length 448


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Mon Jun 29, 2009 10:38 am
Reply with quote

Hi,

I am getting a error when i am copying a VB file of length 446 to another file of lenght 448. I am placing the 1st 2 positions of the output file free and copying the input file to output file from the 3rd position.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/446)
//SORTOUT DD DSN=...  output file(VB/448)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL OUTREC=(7:5,442)
/*


Is there any alternate method of copying the file.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jun 29, 2009 12:47 pm
Reply with quote

What error are you getting?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 29, 2009 1:44 pm
Reply with quote

It is no good showing us the code that you have used without the error messages and codes displayed at the time of error.

Today is not psychic day icon_lol.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 29, 2009 3:35 pm
Reply with quote

well, you don't have 442 bytes available from position 7 of the input file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 29, 2009 4:07 pm
Reply with quote

Try this - you must code 1,4 at the start for VB records, 2X is two spaces, and the 5 with no length means copy the rest of the VB record.
Code:

//SYSIN    DD    *
  OPTION COPY
  OUTFIL OUTREC=(1,4,2X,5)
/*
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Mon Jun 29, 2009 5:08 pm
Reply with quote

Thanks for helping that Out. This Code has worked.
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Tue Jul 07, 2009 11:24 am
Reply with quote

Hi, I am getting an error when i am copying the file with specific sort conditions

The Error message for the sort codition is
Code:

ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 00:50 ON TUE JU
             SORT FIELDS=COPY
             OUTFIL OUTREC=(1,4,2X,7:5,106,112:189,258,369:112,78)
ICE201I F RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE150I 1 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 04, IFTHEN 0
ICE751I 0 C5-K90014 C6-K90014 C7-K45047 C8-K42136 E9-K40168 E7-K44564
ICE052I 3 END OF DFSORT



Could anyone please help me out of this
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 07, 2009 8:34 pm
Reply with quote

If you had actually looked up the message, you would see that reason code 4 means the following:

Code:

A column overlapped the previous output field in the reformatted record.
Example (fixed-length input):

          INREC IFTHEN=(WHEN=INIT,
                  BUILD=(81:SEQNUM,8,ZD)),
                IFTHEN=(WHEN=(81,8,ZD,EQ,+1),
                  BUILD=(3,20,20:C'ABC'))


In your case, you have 7:5,106 which goes up to output position 112, but you have 112: as the next output position so it overlaps. You should have 113: and the remaining positions should be adjusted accordingly. If you don't specify the c: items, DFSORT will figure out where to start the next output field automatically.
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Wed Jul 08, 2009 10:12 am
Reply with quote

Thanks For the Reply Frank.


I tried adjusting the lengths correctly but this time it is giving the error ICE218A

Code:

ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 23:34 ON TUE JU
             SORT FIELDS=(5,2,PD,A,7,4,PD,A,11,4,PD,A)
             OPTION VLSCMP
             OUTFIL OUTREC=(1,4,5:2X,7:5,106,113:189,258,371:111,78)
ICE201I F RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE751I 0 C5-K90014 C6-K90014 C7-K45047 C8-K42136 E9-K40168 C9-BASE   E5-K45240
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICETD1 ENVIRONMENT SELECTED
ICE088I 0 R1493CIS.STEP0010.        , INPUT LRECL = 446, BLKSIZE = 27998, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,16777216,16777216)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (16732144,16719856)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=Y,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=16777216,MAXLIM=1048576,MINLIM=262144,EQUALS=Y,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=N,OUTREL=N,CKPT
ICE131I 0 OPTIONS: TMAXLIM=16777216,ARESALL=12288,ARESINV=0,OVERRGN=65536,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=Y,ZDPRINT=Y,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=N
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 658278910 TC 0 CS DSVRR KSZ 17 VSZ 17
ICE752I 0 FSZ=658278910 BC  IGN=0 E  AVG=238 0  WSP=912502 C  DYN=0 0
ICE231I 0 STORAGE USED FOR OUTFIL : BELOW 16M = 20480, ABOVE 16M = 2127872
ICE210I 0 SORTOUT  : EXCP USED, LRECL = 448, BLKSIZE = 27998, TYPE = VB
ICE218A 3 190 BYTE VARIABLE RECORD IS SHORTER THAN 446 BYTE MINIMUM FOR SORTOUT
ICE751I 1 D8-BASE   D4-K38900 EA-BASE   CB-K90014 F1-K38900 E8-K44564
ICE052I 0 END OF DFSORT



I couldn't understand why this is causing the error.
I have tried with multiple conditions of OPTION = VLSCMP / VLSHRT but getting the same error.

Is there any other way i can achieve this.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jul 08, 2009 8:29 pm
Reply with quote

You're getting that error because you have a VB input record that does not contain an input field you're using in the OUTREC operand. You have 189,258 which requires an input length of 446 bytes, but one of your input records is only 190 bytes. VLSCMP only affects INCLUDE/OMIT. VLSHRT only affects SORT and INCLUDE/OMIT. But your problem is with OUTREC (BUILD), so VLSCMP and VLSHRT have no effect.

The real question is: what do you want DFSORT to do with these "short" fields. Do you want it to fill in the missing bytes with blanks (or another character)? Or do you want to remove the short records? Or what?
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Thu Jul 09, 2009 10:35 am
Reply with quote

Thanks for the reply Frank.

I have achieved this in 3 steps

Step(1) - Converted the VB file (lrecl=446) to FB file (lrecl=442)

Code:

SORT FIELDS=COPY
OUTFIL OUTREC=(1:5,442),VTOF


Step(2) - Changed the output format as required (both input and output are FB files with lrecl=442)

Code:

SORT FIELDS=COPY
OUTFIL OUTREC=(1:1,106,107:185,258,365:107,78)


Step(3) - Now copied the Input FB file (lrecl=442) to Output VB file (Lrecl=448)

Code:

   SORT FIELDS=COPY
   OUTFIL OUTREC=(3:1,442),FTOV


Can you help me if this can be achieved in a single step
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jul 09, 2009 8:41 pm
Reply with quote

Your job fills in blanks for the missing bytes. You can do that in one pass like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/446)
//SORTOUT DD DSN=... output file (VB/448)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL BUILD=(1,4,2X,5,106,189,258,111,78),VLFILL=C' '
/*
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Sat Jul 11, 2009 10:57 am
Reply with quote

Thanks Frank.

The sort cord is working good.
Thanks for the Help. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top