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

Sort card to format/Change the pos. of the fields in VB file


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

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Tue Jul 02, 2013 3:56 pm
Reply with quote

Hi Team,

I am trying to replace the data in the fields(records).

My input is :

Code:
----+----1----+----2----
************************
KUNAL1 111111 ABCD     
KUNAL1 222222 ABCD     
KUNAL1 333333 ABCD     
KUNAL2 111111 CDEF     
KUNAL2 111111 ABCD     
KUNAL2 111111 ABCD     
************************

My objective is to replace the fields in 15th position (ABCD for example in first record) with the fields starting at 8th position (111111 for example in first record).

My sort card:
Code:
//STEP010 EXEC  PGM=SORT,REGION=1024K,COND=(0,NE)             
//SORTLIB  DD DSN=SYS1.SORTLIB,DISP=SHR                       
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=*                                         
//SORTWK01 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTWK02 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTWK03 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTWK04 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTWK05 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTWK06 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)   
//SORTIN   DD DSN=FIVAT.KUNAL.FILE,DISP=SHR                   
//SORTOUT  DD DSN=FIVAT.KUNAL.FILE1,DISP=SHR                   
//*          SPACE=(TRK,(50,10),RLSE)                         
//SYSIN    DD *                                               
      SORT FIELDS=COPY                                         
      INREC BUILD=(12:19,4,19:12,6)                           
/* 


The error I am getting :
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 V1R12 - 12:03 ON TUE JU
                SORT FIELDS=COPY                                               
                INREC BUILD=(12:19,4,19:12,6)                                   
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE251A 0 MISSING RDW OR DATA FOR *INREC  : REASON CODE 01, IFTHEN 0         
ICE751I 0 C5-K76982 C6-K90026 C7-K82419 C8-K91592 E9-K60824 E7-K79990           
ICE052I 3 END OF DFSORT                                                         
******************************** BOTTOM OF DATA ********************************
Could you please help me achieve the desired output?

Let me know incase more information is needed.

Code'd
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jul 02, 2013 4:09 pm
Reply with quote

As it is a VB record you need to define the RDW, try the following - untested
Code:
   INREC BUILD=(1,4,12:19,4,19:12,6)


And also, please learn to use the CODE tags.
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Tue Jul 02, 2013 4:20 pm
Reply with quote

Thanks a lot Expat....

Got it icon_smile.gif
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Tue Jul 02, 2013 8:11 pm
Reply with quote

Dear Team,

I have a requirement wherein, I have to keep the field positioned 194, which is a 4 char field, in position 8. And, the rest of the records will have to be at their respective positions.

My sort cord:

Code:
//STEP010 EXEC  PGM=SORT,REGION=1024K,COND=(0,NE)                 
//SORTLIB  DD DSN=SYS1.SORTLIB,DISP=SHR                           
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTWK01 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK02 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK03 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK04 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK05 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK06 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTIN   DD DSN=FIVAT.FISCAL.OUTPUT,DISP=SHR                     
//SORTOUT  DD DSN=FIVAT.FISCAL.OUTPUT1,DISP=SHR                   
//*          SPACE=(TRK,(50,10),RLSE)                             
//SYSIN    DD *                                                   
     INREC FIELDS=(1:1,4,5:5,7,12:198,4,16:12,186,202:202,57)     
      SORT FIELDS=COPY


Input file has 402531 records in it.

When I use the above Sort card, I get the below error message.

Code:
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE751I 0 C5-K76982 C6-K90026 C7-K82419 C8-K91592 E9-K60824 C9-BASE   E5-K80744
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS         
ICE088I 0 IN22790A.STEP010 .        , INPUT LRECL = 300, BLKSIZE = 27998, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)                                 
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)                           
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=8192,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=100    ,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y                                         
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT                                   
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN                                   
ICE805I 1 JOBNAME: IN22790A , STEPNAME: STEP010                                 
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                     
ICE889I 0 CT=MAX     , SB=8, L=0, D=0000, CCW=1MAM                             
ICE902I 0 O PP10  I PP11                                                       
ICE218A 6 [b]241 BYTE VARIABLE RECORD IS SHORTER THAN 258 BYTE MINIMUM FOR         [/b]
ICE751I 1 EF-BASE   F0-K91597 E8-K79990                                         
ICE052I 0 END OF DFSORT       



In the output file, all the fields are getting written, but the count of the records is decreased from 402531 to 401652.

254 is the structure length.

Both input and output files are VB.

I have gone through the error message description of ICE218A, but I could not get much out of it.
Could you please help me in solving the problem ?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 02, 2013 8:14 pm
Reply with quote

Hi,

What is the Record length of FIVAT.FISCAL.OUTPUT??

From Manual

Quote:
INREC Statement Notes
v When INREC is specified, DFSORT reformats the input records
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Tue Jul 02, 2013 8:15 pm
Reply with quote

Hi,

LRECL of FIVAT.FISCAL.OUTPUT is 300.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 02, 2013 8:26 pm
Reply with quote

Try using

Code:
  OPTION VLSHRT
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Tue Jul 02, 2013 8:31 pm
Reply with quote

Hi,

Thanks for the quick reply.

I have tried using OPTION VLSHRT. But, Still I am getting the same error.

Sort card:

Code:
//STEP010 EXEC  PGM=SORT,REGION=1024K,COND=(0,NE)                 
//SORTLIB  DD DSN=SYS1.SORTLIB,DISP=SHR                           
//SYSPRINT DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTWK01 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK02 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK03 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK04 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK05 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTWK06 DD UNIT=3390,SPACE=(CYL,5),DISP=(,DELETE,DELETE)       
//SORTIN   DD DSN=FIVAT.FISCAL.OUTPUT,DISP=SHR                   
//SORTOUT  DD DSN=FIVAT.FISCAL.OUTPUT1,DISP=SHR                   
//*          SPACE=(TRK,(50,10),RLSE)                             
//SYSIN    DD *                                                   
      OPTION VLSHRT                                               
     INREC FIELDS=(1:1,4,5:5,7,12:198,4,16:12,186,202:202,57)     
      SORT FIELDS=COPY 
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 02, 2013 8:58 pm
Reply with quote

Kunal Surpurkar,

Your JCL is a mess. You are just copying the input and output and you don't need all those SORTWK allocation. You don't need the REGION parm your exec statement. You don't need the SORTLIB or SYSPRINT dd's too. Why do you have DISP=SHR on your SORTOUT?

If your intention is to just copy the contents of 198 on to position 12 you just need OVERLAY instead of BUILD

Use this DFSORT JCL

Code:

//STEP010  EXEC PGM=SORT,COND=(0,NE)                 
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=FIVAT.FISCAL.OUTPUT,DISP=SHR
//SORTOUT  DD DSN=FIVAT.FISCAL.OUTPUT1,
//            DISP=(NEW,CATLG,DELETE),
//*           SPACE=(TRK,(50,10),RLSE)
//SYSIN    DD *
  OPTION COPY
  INREC OVERLAY=(12:198,4)
//*


Pandora-Box,

Please do not mislead. VLSHRT specifies whether DFSORT is to continue processing if a "short" variable-length SORT/MERGE control field, INCLUDE/OMIT compare field, or SUM summary field is found.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 02, 2013 9:02 pm
Reply with quote

Opps If I did mislead icon_redface.gif

But what does the below mean please throw some light

Quote:
ICE218A 6 241 BYTE VARIABLE RECORD IS SHORTER THAN 258 BYTE MINIMUM FOR
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 02, 2013 9:11 pm
Reply with quote

Pandora-Box wrote:
Opps If I did mislead icon_redface.gif

But what does the below mean please throw some light

Quote:
ICE218A 6 241 BYTE VARIABLE RECORD IS SHORTER THAN 258 BYTE MINIMUM FOR


Pandora-Box,

How about reading upon the message ICE218A? Read the programmer's response.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cm60/2.2.208
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 02, 2013 10:26 pm
Reply with quote

Thanks Kolusu
Back to top
View user's profile Send private message
Kunal Surpurkar

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Wed Jul 03, 2013 7:35 pm
Reply with quote

Thanks guys,

Issue resolved icon_smile.gif

Thanks a lot for your time !
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top