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

sort card for packed to unpacked file....


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Jul 27, 2012 6:20 pm
Reply with quote

Hi friends,

I have a file with record length of 156. In between the record there are comp-3 (packed) fields at positions 25,51,59,72,77,80,85,88-----as below. and remaing fields are alphanumeric.

Now, how should i handle the output file length in dsn??? should i calculate manually and add the length in dsn??? or else the starting position of remaining fields will be handle by dfssort automatically.

more over the below is not working could you please help me in this regard...

Code:
SORT FIELDS=COPY                                             
INREC BUILD=((02,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),         
               (25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),       
               (51,8,PD,EDIT=(STTTTTTTTTTTTTTTT),SIGNS=(+,-)),
               (59,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-)),         
               (72,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),     
               (77,2,PD,EDIT=(STTTT),SIGNS=(+,-)),           
               (80,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),     
               (85,3,PD,EDIT=(STTTTTT),SIGNS=(+,-)),         
               (88,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (94,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (100,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (106,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (112,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (118,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),     
               (124,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),   
               (143,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),     
               (148,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))

the code tags ... the fk*** code tags
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Jul 27, 2012 6:36 pm
Reply with quote

Bill Woodger wrote:
As well as that, and subsequent, can you show the output messages you get from your run? Unless you are now using DFSORT, you'll not get further in this forum.


ITS PROMPTING syntax error...

Code:
JOBNAME: P715448S , STEPNAME: SORT01                                         
BLOCKSET     TECHNIQUE IN CONTROL                                           
BLOCKSET     COPY  TECHNIQUE SELECTED                                       
VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 22:49 ON FRI JUL 27, 2
    SORT FIELDS=COPY                                                    00001
    INREC BUILD=((02,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                   
                          $                                                 
SYNTAX ERROR                                                                 
                 (25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                   
                 $                                                           
SYNTAX ERROR                                                                 
                 (51,8,PD,EDIT=(STTTTTTTTTTTTTTTT),SIGNS=(+,-)),             
                 $                                                           
SYNTAX ERROR                                                                 
                 (59,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-)),                     
                 $                       

1 SYNTAX ERROR                                     
0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685
3 END OF DFSORT                                   

                                   
at the end....its prompting  as
1 SYNTAX ERROR                                     
0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685
3 END OF DFSORT                                   
 

what could be the reason...and another thing is suppose for s9(13)v99 should i need to take 17 or 18 ((51,8,PD,EDIT=(STTTTTTTTTTTTTTTT),SIGNS=(+,-)) because for to get unpacked should i
count decimal also???
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Jul 27, 2012 6:58 pm
Reply with quote

i don't know how to post as code...thats the reason i'm posting like that. after that some moderators are changing as it has to be. i totally agree on what u said...

Is that by selecting code option should we can post as it was to be so????

Code:


000003 //*                                                                     
000004 //*--------------------------------------------------------------------
000005 //*
000006 //*--------------------------------------------------------------------
000007 //*                                                                     
000008 //SORT01   EXEC ******                                               
000009 //SORTIN   DD DSN=P715448.FL02277.PACKED1,DISP=SHR                     
000010 //SORTOUT  DD DSN=P715448.FL02277.UNP1,                                 
000011 //            DISP=(NEW,CATLG,DELETE),                                 
000012 //            SPACE=(CYL,(5,1),RLSE),                                   
000013 //            DCB=(RECFM=FB,LRECL=220,BLKSIZE=0)                       
000014 //SYSIN   DD *                                                         
000015     SORT FIELDS=COPY                                                   
000016     INREC BUILD=((02,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000017                  (25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000018                  (51,8,PD,EDIT=(STTTTTTTTTTTTTTTT),SIGNS=(+,-)),       
000019                  (59,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-)),                 
000020                  (72,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000021                  (77,2,PD,EDIT=(STTTT),SIGNS=(+,-)),                   
000022                  (80,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000023                  (85,3,PD,EDIT=(STTTTTT),SIGNS=(+,-)),                 
000024                  (88,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000025                  (94,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000026                  (100,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000027                  (106,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000028                  (112,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000029                  (118,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000030                  (124,6,PD,EDIT=(STTTTTTTTTTTT),SIGNS=(+,-)),           
000031                  (143,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),             
000032                  (148,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))             
000033 //*                                                                     



i have mentioned the main part of the code...ok pls understand...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jul 27, 2012 7:03 pm
Reply with quote

as usual waiting lazily for somebody to do something YOU SHOULD BE DOING

by the way I edited Your posts to add the code tags.

after all it does not seem overly complicated to <mouse> select the JCL statements

click on the [ code ] button

use preview to see if the result is what You asked

and note that even after Your insults I keep doing my moderator job icon_cool.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jul 27, 2012 7:09 pm
Reply with quote

Ram,

I suggest you remove your DCB parms from the SORTOUT DD statement.
DFSORT will calculate the appropriate LRECL,
and if you have provided a DCB-LRECL parm that is 'inaccurate',
DFSORT will give you a message.

In the event that you have some production 'rules'
that state the complete DCB parm be included,
suggest that after you have tested your control cards,
you code your LRECL parm according to DFSORT's calculation.
That way it will be correct,
and you can pass the muster of production turnover requirements.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jul 27, 2012 7:13 pm
Reply with quote

and searching ( something that the TS refuses to do ) for INREC BUILD EDIT
using the Search for all terms option

in the dfsort/icetool section
would have returned zillions of hits with properly coded dfsort statements for the task at stake
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jul 27, 2012 7:16 pm
Reply with quote

Quote:
see here also u didnt suggested me an answer instead responded as u ever do...


because I do not see any reason to post something that You could find out Yourself by reading the smart sort tricks or searching the forums
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jul 27, 2012 7:42 pm
Reply with quote

but since as I said before today I am in a really good mood icon_biggrin.gif
but hell will freeze before considering any friendship between us icon_cool.gif

the misuse of double parenthesization was evident at first reading
but to convince the TS I just run a simple test
( values and offsets different but enough for a POC )

Code:
 ****** ***************************** Top of Data ******************************
 ......
 000004 //S1      EXEC PGM=SORT                                                 
 000005 //SYSOUT    DD SYSOUT=*                                                 
 000006 //SORTIN    DD *                                                       
 ------------------------------------------------------------------------------
 000007                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000C000C000C000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000008                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000D000D000D000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000009 //SORTOUT   DD SYSOUT=*                                                 
 000010 //SYSIN     DD *                                                       
 000011   OPTION COPY                                                           
 000012   INREC BUILD=((1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                 
 000013                (5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                 
 000014                (9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))                 
 ****** **************************** Bottom of Data ****************************

and here is the result ( EXPECTED )

Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 16:01 ON FRI JU
            OPTION COPY                                                         
            INREC BUILD=((1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),               
                                 $                                             
ICE007A E SYNTAX ERROR                                                         
                         (5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),               
                         $                                                     
ICE007A 1 SYNTAX ERROR                                                         
                         (9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))               
                         $                                                     
ICE007A 1 SYNTAX ERROR                                                         
ICE751I 0 C5-K90014 C6-K90014 C7-BASE   C8-K90014 E7-BASE                       
ICE052I 3 END OF DFSORT     


but when using the proper syntax

Code:
 ****** ***************************** Top of Data ******************************
 ......
 000004 //S1      EXEC PGM=SORT                                                 
 000005 //SYSOUT    DD SYSOUT=*                                                 
 000006 //SORTIN    DD *                                                       
 ------------------------------------------------------------------------------
 000007                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000C000C000C000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000008                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000D000D000D000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000009 //SORTOUT   DD SYSOUT=*                                                 
 000010 //SYSIN     DD *                                                       
 000011   OPTION COPY                                                           
 000012   INREC BUILD=(1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),                 
 000013                5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),                 
 000014                9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))                 
 ****** **************************** Bottom of Data ****************************


I get the desired result ( as EXPECTED )

Code:
********************************* TOP OF DATA **********************************
+0000000001+0000000002+0000000003                                               
-0000000001-0000000002-0000000003                                               
******************************** BOTTOM OF DATA ********************************


naturally the TS will complain about something
no reason to waste time commenting on the TS behavior and attitude
icon_wink.gif

but really... if the TS is not willing/capable of analyzing himself such stupid errors
or search for hints ( I did before commenting )
a career change is warmly recommended
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jul 27, 2012 11:23 pm
Reply with quote

ram_vizag,

Please don't take that condescending tone with the people who are trying to Guide/help you. Not everyone has the time or patience to provide complete solutions.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Jul 30, 2012 4:17 pm
Reply with quote

enrico-sorichetti wrote:
but since as I said before today I am in a really good mood icon_biggrin.gif
but hell will freeze before considering any friendship between us icon_cool.gif

the misuse of double parenthesization was evident at first reading
but to convince the TS I just run a simple test
( values and offsets different but enough for a POC )

Code:
 ****** ***************************** Top of Data ******************************
 ......
 000004 //S1      EXEC PGM=SORT                                                 
 000005 //SYSOUT    DD SYSOUT=*                                                 
 000006 //SORTIN    DD *                                                       
 ------------------------------------------------------------------------------
 000007                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000C000C000C000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000008                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000D000D000D000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000009 //SORTOUT   DD SYSOUT=*                                                 
 000010 //SYSIN     DD *                                                       
 000011   OPTION COPY                                                           
 000012   INREC BUILD=((1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                 
 000013                (5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),                 
 000014                (9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))                 
 ****** **************************** Bottom of Data ****************************

and here is the result ( EXPECTED )

Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 16:01 ON FRI JU
            OPTION COPY                                                         
            INREC BUILD=((1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),               
                                 $                                             
ICE007A E SYNTAX ERROR                                                         
                         (5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)),               
                         $                                                     
ICE007A 1 SYNTAX ERROR                                                         
                         (9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-)))               
                         $                                                     
ICE007A 1 SYNTAX ERROR                                                         
ICE751I 0 C5-K90014 C6-K90014 C7-BASE   C8-K90014 E7-BASE                       
ICE052I 3 END OF DFSORT     


but when using the proper syntax

Code:
 ****** ***************************** Top of Data ******************************
 ......
 000004 //S1      EXEC PGM=SORT                                                 
 000005 //SYSOUT    DD SYSOUT=*                                                 
 000006 //SORTIN    DD *                                                       
 ------------------------------------------------------------------------------
 000007                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000C000C000C000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000008                                                                         
        000100020003444444444444444444444444444444444444444444444444444444444444
        000D000D000D000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
 000009 //SORTOUT   DD SYSOUT=*                                                 
 000010 //SYSIN     DD *                                                       
 000011   OPTION COPY                                                           
 000012   INREC BUILD=(1,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),                 
 000013                5,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-),                 
 000014                9,4,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))                 
 ****** **************************** Bottom of Data ****************************


I get the desired result ( as EXPECTED )

Code:
********************************* TOP OF DATA **********************************
+0000000001+0000000002+0000000003                                               
-0000000001-0000000002-0000000003                                               
******************************** BOTTOM OF DATA ********************************


naturally the TS will complain about something
no reason to waste time commenting on the TS behavior and attitude
icon_wink.gif

but really... if the TS is not willing/capable of analyzing himself such stupid errors
or search for hints ( I did before commenting )
a career change is warmly recommended




hi enrico,

thanks a lot...but even then my requirement is not only that...here in need to handle as following:

1.i have some 10 fieelds strating from 10, 25, 36, respectively...the rest being normal redable fields (unpacked oNLY)

suppose i want to convert pac to unpac from field length 6 to 2 and also i want the former field in my output file

examlpe:

---------(cols)
12345..7899..89989..

then i want the first 5 length of data in my output file and the 6,7 legth flds to be converted to unpac and again 8,9,10,11 length flds (as above) to be in output file and again 12,13 pac flds to be unpacked and shud b added in the output file: i have written the code in below but its giving some
Code:

INCONSISTENT REFORMATTING ERROR. THE CODE AND RESULT ARE BELOW:

SORT FIELDS=COPY                                             
OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),         
               8:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))


RESULT:


H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
1 JOBNAME: P715448S , STEPNAME: SORT01                                 
0 BLOCKSET     TECHNIQUE IN CONTROL                                     
0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 20:36 ON MON JU
      SORT FIELDS=COPY                                                 
      OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),             
                     8:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))   
H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
2 INCONSISTENT REFORMATTING FOR *OUTREC : REASON CODE 04, IFTHEN 0     
0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685                     
3 END OF DFSORT

Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 30, 2012 4:26 pm
Reply with quote

Your 1,5 gives you five bytes. Your EDIT gives you five bytes. You then use column 8, which would be overwriting some of your edited field. You can't do that with FIELDS/BUILD.

If you look at the error message you got (why you or "something" chops the most useful bit off, I don't know) you should have been able to get to that.

Or just by counting.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Jul 30, 2012 4:31 pm
Reply with quote

Bill Woodger wrote:
Your 1,5 gives you five bytes. Your EDIT gives you five bytes. You then use column 8, which would be overwriting some of your edited field. You can't do that with FIELDS/BUILD.

If you look at the error message you got (why you or "something" chops the most useful bit off, I don't know) you should have been able to get to that.

Or just by counting.


hi,

even if i give from 9th position the same is coming...i think it need to be handled differently...because no syntax error
Code:



SORT FIELDS=COPY                                             
OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),         
               9:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))

result:


 H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 1 JOBNAME: P715448S , STEPNAME: SORT01                                 
 0 BLOCKSET     TECHNIQUE IN CONTROL                                     
 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 20:59 ON MON JU
       SORT FIELDS=COPY                                                 
       OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),             
                      9:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))   
 H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 2 INCONSISTENT REFORMATTING FOR *OUTREC : REASON CODE 04, IFTHEN 0     
 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685                     
 3 END OF DFSORT                                                         
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Jul 30, 2012 4:33 pm
Reply with quote

ram_vizag wrote:
Bill Woodger wrote:
Your 1,5 gives you five bytes. Your EDIT gives you five bytes. You then use column 8, which would be overwriting some of your edited field. You can't do that with FIELDS/BUILD.

If you look at the error message you got (why you or "something" chops the most useful bit off, I don't know) you should have been able to get to that.

Or just by counting.


hi,

even if i give from 9th position the same is coming...i think it need to be handled differently...because no syntax error
Code:



SORT FIELDS=COPY                                             
OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),         
               9:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))

result:


 H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 1 JOBNAME: P715448S , STEPNAME: SORT01                                 
 0 BLOCKSET     TECHNIQUE IN CONTROL                                     
 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 20:59 ON MON JU
       SORT FIELDS=COPY                                                 
       OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),             
                      9:11,14,25,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))   
 H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 2 INCONSISTENT REFORMATTING FOR *OUTREC : REASON CODE 04, IFTHEN 0     
 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E7-K70685                     
 3 END OF DFSORT                                                         



and in the file 10 bytes was being redfined 3 times and in that redefines part every time 5 bytes at different positions was being used as comp-3...and this is also not working if i test it individually...could you please suggest...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 30, 2012 4:34 pm
Reply with quote

As far as I'm aware, 5 + 5 is 10. Implication being to start in 11: if you feel the desperate need to specify a column.

I'd do it without a column, personally, then I don't need to get the counting correct myself, I let DFSORT do it...

Don't worry about the abscence of a "syntax error". You "syntax" is correct, you are just using it incorrectly.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Jul 30, 2012 4:47 pm
Reply with quote

Bill Woodger wrote:
As far as I'm aware, 5 + 5 is 10. Implication being to start in 11: if you feel the desperate need to specify a column.

I'd do it without a column, personally, then I don't need to get the counting correct myself, I let DFSORT do it...

Don't worry about the abscence of a "syntax error". You "syntax" is correct, you are just using it incorrectly.


hi bill,

my code and out is here
Code:


input:

1NTVN 
1NTVN 
1NTVR 
1NTVR 

code:

SORT FIELDS=COPY                                     
OUTREC FIELDS=(1:1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-))

output
1NTVN+0001
1NTVN+0001
1NTVR+0001
1NTVR+0001






now again i need to copy the data from 8 to 24 to output file which is unpacked already and need to convert data starting 25th position to some 5 bytes data from pack to unpack and again need to write to output file...this should be followed upto 156 length of recod data...
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Jul 30, 2012 5:02 pm
Reply with quote

Hi enrico/bill,

how can this be hadled to get done automatically???
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jul 30, 2012 5:18 pm
Reply with quote

Bill,
time to lock the topic ? icon_eek.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 30, 2012 5:21 pm
Reply with quote

Not sure what you mean by "automatically".

If you are now getting correct output for your first edited field (you didn't say), just repeat the process for all fields by extending your FIELDS

Code:
  OUTREC FIELDS=(1,5,6,2,PD,EDIT=(STTTT),SIGNS=(+,-),
                          8,youworkoutthelength,25,anotherlength,PD,EDIT=(appropriatestuff,with SIGNS if needed,
                startofnextfixedbit, etc,continuetypinguntilend)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 30, 2012 5:33 pm
Reply with quote

enrico, missed that whilst I was typing.

Ram,

The only thing I can think is that you are confused about what all those those positions mean on FIELDS.

Since FIELDS and BUILD are the same (wait for a step-on from Kolusu or sqlcode1 if I'm wrong) I prefer BUILD.

All the source fields you specify are from the "current" record at that stage.

Code:
  BUILD=(30X,1,10)


This will give you 30 blanks, then position 1 for a length of 10 from the current input.

After the build, if you want to refer to what was at 1,10, you have to specify 31,10.

When specifying a column you are specifying a position in the new record. With BUILD/FIELDS you cannot "overlap" fields, you cannot destroy anything that you have placed in the new record with BUILD/FIELDS.

After such an amount of time on this, it turns out to be something very basic you have a problem with.

I will shortly follow enrico's advice.

EDIT. Except I left the door open for Kolusu/others to comment, so I can't... later today then.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Jul 30, 2012 10:16 pm
Reply with quote

ram_vizag wrote:
Hi enrico/bill,

how can this be hadled to get done automatically???


Stop specifying the output positions and let sort calculate it automatically. Alternatively you can count the digits in the edit mask and specify the position.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. 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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top