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
 

 

Convert the fields using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Convert the fields using sort
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

Site Director


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

PostPosted: Fri Aug 12, 2011 10:22 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Aug 12, 2011 12:09 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Convert the fields using sort
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

Site Director


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

PostPosted: Fri Aug 12, 2011 1:17 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Aug 12, 2011 3:54 pm    Post subject: Reply to: Convert the fields using sort
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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 Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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