Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copy a VB file of length 446 to VB file of length 448
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

Senior Member


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

PostPosted: Mon Jun 29, 2009 12:47 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 29, 2009 1:44 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 29, 2009 4:07 pm    Post subject:
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    Post subject: Reply to: Copy a VB file of length 446 to VB file of length
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    Post subject: Reply to: Copy a VB file of length 446 to VB file of length
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 Moderator


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

PostPosted: Tue Jul 07, 2009 8:34 pm    Post subject:
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    Post subject: Reply to: Copy a VB file of length 446 to VB file of length
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 Moderator


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

PostPosted: Wed Jul 08, 2009 8:29 pm    Post subject:
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    Post subject: Reply to: Copy a VB file of length 446 to VB file of length
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 Moderator


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

PostPosted: Thu Jul 09, 2009 8:41 pm    Post subject:
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    Post subject: Reply to: Copy a VB file of length 446 to VB file of length
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us