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

Convert the fields using sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Fri Aug 12, 2011 10:05 am
Reply with quote

Hi,
I have the following requirement. My input file is having the following data.
Input file ABC file length = 80

ON,307,20100501-20100630,05,13,310,311
BC,307,20100501-20100630,05,12,310,816
NS,311,20100501-20100630,13,15,312,311

I want to convert this file by appending 'ZERO' before 307 i.e. at position 4 , before 310 at position 33 and before 311 at position 38 in the first record , and it will be done for all the records in the file (here i am explaining it for the first record for understanding). All the fields referred are numeric fields only.

ON,0307,20100501-20100630,05,13,0310,0311
BC,0307,20100501-20100630,05,12,0310,0816
NS,0311,20100501-20100630,13,15,0312,0311

I tried the following sort card it is not working.

Code:

SORT FIELDS=COPY                                               
OUTREC FIELDS=(1:1,3,4:X'00',5:4,3,8:7,25,33:X'00',34:32,4,   
               38:X'00',39:36,3,42:39X)                       


Please help me for the solution.

Thanks,
Nagaraja
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 12, 2011 10:22 am
Reply with quote

Hello,

Do NOT post "it is not working". This is just a waste of time/space. . .

Post all of the messages (including message ids) generated by the problem run.

Post the jcl submitted.
Back to top
View user's profile Send private message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Fri Aug 12, 2011 10:40 am
Reply with quote

Hi Dick,

It is not working means , the expected result not came, the job went fine, where as the output the values for the fields is coming as junk. The below is the output. Dot is coming instead of ZERO.

ON,.307,20100501-20100630,05,13,.310,.311
BC,.307,20100501-20100630,05,12,.310,.816
NS,.311,20100501-20100630,13,15,.312,.311.

I think my sort card is wrong, can you please let me know the correct one.

The below is the job step.
Code:

//PS030    EXEC PGM=SYNCSORT                                               
//SORTIN   DD  DSN=&HLQ01..&RGN02.&JOB01..S.PARM,                         
//             DISP=SHR                                                   
//SORTOUT  DD  DSN=&HLQ01..&RGN.&JOB01..S.PARM,                                                 
//             BUFNO=30,                                                   
//             DISP=(NEW,CATLG,DELETE),                                   
//             RECFM=FB,                                               
//             LRECL=80                                                   
//*                                                                       
//SYSIN    DD  DSN=V835.TESTING.JCL(SORT),DISP=SHR           
  ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
   SORT FIELDS=COPY                                                       
   OUTREC FIELDS=(1:1,3,4:X'00',5:4,3,8:7,25,33:X'00',34:32,4,           
                  38:X'00',39:36,3,42:39X)                               
//*                                                                     
//SYSOUT   DD  SYSOUT=&SOUT01                                           
//SYSUDUMP DD  SYSOUT=&SOUT01                                           
//SYSPRINT DD  SYSOUT=&SOUT01                                           
                                               
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 12, 2011 10:48 am
Reply with quote

instead of a binary zero X'00'
why not use a char zero C'0'
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 12, 2011 12:09 pm
Reply with quote

Hello,

Is this now working?

As you have been a member for almost 6 years, i believe you know that Syncsort topics do not belong in the DFSORT part of the forum. They belong here in the JCL part of the forum (where your topic has been moved).

On the other hand, posting your jcl and sort control using the Code tag (and including the "ruler") was the way to go icon_smile.gif
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Aug 12, 2011 12:25 pm
Reply with quote

X'00' is low-values...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 12, 2011 12:37 pm
Reply with quote

as I continue my diatribe against miss-used terminology,

let me say that low-values is a COBOL figurative literal,
which means in COBOL binary zeros.

For DFSORT/Syncsort (actually anything except COBOL), the term would be Binary zeros.
low-values only has meaning to COBOL people.
Back to top
View user's profile Send private message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Fri Aug 12, 2011 1:04 pm
Reply with quote

Hi,

I tried with char Zero , it is also giving the same result.

Thanks,
Nagaraja
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 12, 2011 1:17 pm
Reply with quote

Hello,

Please post your new sort control code.

Also, post the first record of the output in hex.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri Aug 12, 2011 3:54 pm
Reply with quote

This
Code:
//STEP010  EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
ON,307,20100501-20100630,05,13,310,311                   
BC,307,20100501-20100630,05,12,310,816                   
NS,311,20100501-20100630,13,15,312,311                   
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  OPTION COPY                                           
  OUTREC FIELDS=(1:1,3,C'0',5:4,3,8:7,25,33:C'0',34:32,4,
                    38:C'0',39:36,3,42:39X)             
//*                                                     
gives

Quote:
******************************** TOP OF DATA *
ON,0307,20100501-20100630,05,13,0310,0311
BC,0307,20100501-20100630,05,12,0310,0816
NS,0311,20100501-20100630,13,15,0312,0311
******************************* BOTTOM OF DATA

So, please show us your JCL and the messages from SYSOUT, as been asked for.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top