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
 

 

Quick way to convert this to either ZD or PD format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Taylortek

New User


Joined: 22 Mar 2008
Posts: 4
Location: Seattle

PostPosted: Sat Mar 29, 2008 10:52 pm    Post subject: Quick way to convert this to either ZD or PD format
Reply with quote

I couldn't find this searching the site but it seems like it would be a common issue. I'm uploading and extract from a SQL database that contains both negative and positive integers. They come up with a fixed position of numbers followed by a - or a + (e.g. 000012545+ or 000012545-).

Is there a quick way to convert this to either ZD or PD format? I tried a few ways using the DFSORT conversion but the numbers keep coming out as positive.
Back to top
View user's profile Send private message

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Sun Mar 30, 2008 5:48 pm    Post subject:
Reply with quote

Hi Taylortek,

Please try following

SORT FIELDS=COPY
OUTREC FIELDS=(1:1,5,CST,PD)

It will convert Signed numeric with trailing separate sign into PD

Hope this helps

Regards
Mayuresh
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: Mon Mar 31, 2008 1:15 am    Post subject:
Reply with quote

Quote:
Please try following

...


Mayuresh,

If you had followed your own advice and tried that, you would have found out that it doesn't work. That syntax is invalid. In the future, please try out your "solutions" with DFSORT before posting them. If you can't do that, then please don't post in this Forum.

Taylortek,

You can use a DFSORT job like this to do what you asked for. I assumed your numeric field was in positions 1-10. The output will be a 6-byte PD field in positions 1-6. Adjust as needed.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file (FB/6)
//SYSIN    DD    *
  OPTION COPY
  SORT FIELDS=COPY
  INREC BUILD=(1:1,10,SFF,TO=PD)
/*
Back to top
View user's profile Send private message
Taylortek

New User


Joined: 22 Mar 2008
Posts: 4
Location: Seattle

PostPosted: Mon Mar 31, 2008 6:25 am    Post subject:
Reply with quote

Worked like a champ. Thanks again
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 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
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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