[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More







R is a programming language and environment used primarily for statistical data analysis.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Experts!

I am running into an error when using CPYFRMIMPF and numerics.    When I run the CPYFRMIMPF command I get these errors..  The copy did not complete for reason code 9. When I have the DDS fields all alpha numeric it works.

This is my CPYFRMIMPF code:

0049.00              CPYFRMIMPF FROMSTMF('/ZIP/ZIPFILE.CSV') +              
0050.00                           TOFILE(*CURLIB/&EDTF) MBROPT(*REPLACE) +  
0051.00                           RCDDLM(*LF) STRDLM(*NONE) +              
0052.00                           RMVBLANK(*TRAILING) RPLNULLVAL(*FLDDFT) +
0052.01                           RMVCOLNAM(*YES)                          
This is a sample of the data from the ZIPFILE.CSV


This is my DDS:

0001.00 0008 A          R ZIPCREC                   TEXT('ZIP RADIUS')
0002.00 0000 A            ZIP              5A         COLHDG('ZIP CODE')
0003.00 0000 A            ZDIST          4P 3     COLHDG('DISTANCE')
0004.00 0000 A            ZCITY        30A         COLHDG('CITY')    
0005.00 0000 A            ZSTATE       4A         COLHDG('STATE')  

Thanks for your help!!
Simplify Active Directory Administration
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.


I'm currently working in AWS and trying to use a Lambda function to automate the creation of my AMIs. I'm doing this via the use of the Python script below, but when I test it it returns an error. Can anyone shed any light on what I should be looking at please?


import boto3
import collections
import datetime
import sys
import pprint

ec = boto3.client('ec2')
#image = ec.Image('id')

def lambda_handler(event, context):
    reservations = ec.describe_instances(
            {'Name': 'tag-key', 'Values': ['backup', 'Backup']},
        'Reservations', []

    instances = sum(
            [i for i in r['Instances']]
            for r in reservations
        ], [])

    print "Found %d instances that need backing up" % len(instances)

    to_tag = collections.defaultdict(list)

for instance in instances:
        retention_days = [
            int(t.get('Value')) for t in instance['Tags']
            if t['Key'] == 'Retention'][0]
    except IndexError:
        retention_days = 7


        #for dev in instance['BlockDeviceMappings']:
        #    if dev.get('Ebs', None) is None:
        #        continue
        #    vol_id = dev['Ebs']['VolumeId']
        #    print "Found EBS volume %s on instance %s" % (
        #        vol_id, instance['InstanceId'])

            #snap = ec.create_snapshot(
            #    VolumeId=vol_id,

I have  a list of lists.  The lists in the list of lists are file names.  I use lapply to read and merge the contents of each list in the list of lists (3 merged contents in this case  which will be the content of 3 files).  Then, I  have to change the name of the 3 resulting files and finally I have to write the contents of the files to each file.

 lc <- list("test.txt", "test.txt", "test.txt", "test.txt")
 lc1 <- list("test.txt", "test.txt", "test.txt")
 lc2 <- list("test.txt", "test.txt")
#list of lists.  The lists contain file names
 lc <- list(lc, lc1, lc2)
#new names for the three lists in the list of lists
 new_dataFns <- list("name1", "name2", "name3")
 file_paths <- NULL
 new_path <- NULL
#add the file names to the path and read and merge the contents of each list in the list of lists
    function(lc) {
     filenames <- file.path(dataFnsDir, lc)
     dataList= lapply(filenames, function (x) read.table(file=x, header=TRUE))
     Reduce(function(x,y) merge(x,y), dataList)
     #   print(dataList)


#add the new name of the file to the path total will be 3 paths/fille_newname.tsv.  
 lapply(new_path, function(new_path){new_path <- file.path(getwd(), new_dataFns)

The statements above work because lc and  new_dataFns are global and I can pass them to the lapply function

#Finally, I need to write the merged contents to the corresponding file (path/name.tsv).  I tried the following statement, but this …
I have one PDC server 2008R2 (D2R03Q02)  holding all FSMO roles and a second PDC server 2012R2 (PowerT130) who is not replicating any more since more than a month.

on PDC1 the command repadmin /showrepl shows no erros
on PDC2 the command repadmin /showrepl contains several errors

the netdom query FSMO shows all roles on PDC D2R03Q02

Connectivity: I can ping both servers

If I try to transfer FSMO to the second PDC PowerT130 I get the  ERROR The current Operations master is offline. The role cannot be transferred.
But the PDC D2R03Q02 is up and running and I can ping it from the second PDC.

Dcdiag show many errors and warnings on both PDC

Errors related to Ldap for example

or warnings like :

Warning: DcGetDcName(PDC_REQUIRED) call failed, error 1355

Warning: DcGetDcName(TIME_SERVER) call failed, error 1355
A Time Server could not be located.
The server holding the PDC role is down.
Warning: DcGetDcName(GOOD_TIME_SERVER_PREFERRED) call failed,
error 1355
A Good Time Server could not be located.

I attached The complet Dcdiag report dcdia.txt

DNSLINT command look good

DNSLint Report

System Date: Fri Jul 20 23:42:26 2018

Command run:

dnslint /ad /s /v

 Root of Active Directory Forest:

Active Directory Forest Replication GUIDs Found:
DC: D2R03Q02
GUID: 1a3677e0-7a77-413b-b70d-f0ede03ff7af

All, I am preparing for MFE (financial engineering). I could not thin of any other forum where i could seek help for clearing my doubts on financial products.

Dear experts, is my below understanding correct?

Is  r>-1  coming from this statement?

&&&1 + r&&&

if 1+r>0, then r>-1

Extract from Stochastic Calculus for Finance 1

We introduce also an interest rate 1^n. One dollar invested in the money

market at time zero will yield 1 + r dollars at time one. Conversely, one dollar

borrowed from the money market at time zero will result in a debt of &&&1 + r&&&

at time one. In particular, the interest rate for borrowing is the same as the

interest rate for investing. It is almost always true that r >= 0, and this is

the case to keep in mind. However, the mathematics we develop requires only

that r > -1.

Kindly guide

Anyone know how to scale out R server/service in MS SQL 2016 and later?
Trying to run

        Dim RetVal As Long
        RetVal = Shell("for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO @if exist %%i: dir %%i:\*.* /s /b >E:\zzz\Zip-Bak\DayBkUp\DirectoryListHistory\%%i.txt")

Get error run time error 53 file not found?

It runs fine in a dos batch file

Trying to create a series of text files with a list of all files on each drive on my computer

Enabling R commands on T-SQL of MS SQL Server
I have installed Microsoft SQL server 2017 and SQL server management studio on my laptop computer with windows 10 Professional.  I am able to connect to the database from management studio.  I have also installed R (version 3.5.0 (The R foundation for Statistical Computing).
I learnt that from SQL server 2016 onwards, MS SQL server permits R commands on T-SQL.
I am familiar with both T-SQL and R commands.
I want to know how to enable execution of R commands on T-SQL.

Anyone know if the R server in SQL 2016 and R and Python feature in SQL 2017 need additional license?

Answer should be a no as MS always license everything SQL server by a single cost and ALL feature is charged already.
I'm not able to send an image with a  text message on my iPhone 6. After selecting the recipient from contacts I select the camera icon to the left of the text field and select an image from my local images.  The image appears at the top of the screen.    Then I enter a text message and  and hit the green uparrow.  In a second I see a red message:  "Not Delivered."  This all repeatable.  The person I'm sending the message to has an Android.   Also, I 'm in range of a WiFi signal so I assume this is all going through WiFi and not Cellular.  Does anyone know what might be going on?

Acronis Data Cloud 7.8 Enhances Cyber Protection
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

I am trying the code below so that if there is neither "/" nor "\" the output is an error and the application stops, but it does not work. I cannot see any thing wrong with the code.  Does any one sees any thing wrong?

 if (grepl("/", OUTpath, fixed=TRUE)) { # mac style
     OUTpath<- paste(paste(unlist(strsplit(OUTpath, "/", fixed=TRUE)), collapse="/"), "/", sep="")
   } else
     if (grepl("\\", OUTpath, fixed=TRUE)) { # windows style
       OUTpath<- paste(paste(unlist(strsplit(OUTpath, "\\", fixed=TRUE)), collapse="\\"), "\\", sep="")
     } else
       if(!grepl("/", OUTpath, fixed=TRUE) || !grepl("\\", OUTpath, fixed=TRUE)){
       trueFalse = FALSE
       errorMessage("Unrecognized path separator in OUTpath or no path specification in PARAMS file. Cannot open connection\n
                             You can edit your input file and save the changes. Afterwards, stop and restart glycoPipe and upload file again")
       stop("Unrecognized path separator in OUTpath\n")
Hi Experts,

I have a Windows 7 Home 64bit machine that wont boot in normal or safe mode....

I have pulled the drive out & backed up the data, run all tests on memory and harddrive (all ok) while I had it out I ran chkdsk /r /f  no issues found. I'm currently downloading a windows 7 disk so I can either attempt to repair from that or am  best of with a W & R? or is there something that may assist in repairing.

Windows repair from boot up does not fix it although I did come across a message about a driver missing?

The user was hacked by some one who called and he let them on his PC one thing I noticed is that windows 7 is installed on the D drive

SQL Join Query.

I am trying to query 3 tables in a database and I am not getting the results back that I am expecting.

Here is the query:

SELECT DISTINCT m.ADName, i.FirstName, i.LastName, r.Description
FROM         Membership AS m INNER JOIN
                         user_information AS i ON m.ADName = i.NT_Username INNER JOIN
                         RolesDescription AS r ON m.RoleID = r.RoleID
WHERE     (m.ApplicationID = 6)

I think its because a record does not exist in the "User_Information" (I would like the result to show a blank field if this is the case)

I am expecting 120 records but I am getting only 106.

any one tried to upgrade the R ( in database) of SQL 2016 ? I have a SQL server 2016 AOG group with 3 x nodes SQL nodes one by one and only one has R (In database) service can't upgrade, any idea?
I want to assign SSL Certificate to my exchagne server 2016 via certificate authority from active directory,
all of the steps, done in proper way,  it show " invalid"
please help me

R. Rahimi
I need to know if there's a way in Excel to have only 3 colors for the "Conditional Formatting" > "3-Color Scale"
to be NOT a "Graded Color Scale".
I only need RED, YELLOW and GREEN, if values fall in between of R and Y, then they come as Orange (Graded Scale effect).
Screen shot with Conditional Formatting
Hi I am in a bit of a crunch on this SQL query here so I appreciate any help.

Lets say I have this part:


I need to find all parts that match above up to the F but then have an R after. For example one of the results that would match would look like this:

select * from inv_master (nolock) where part_no like 'HON787800R%'

I appreciate any help you might be able to offer

Thank you much.
Dear expert

Please help me with a query command you can find below, Now I got problem with variables @P4, @P5, @P6, problem is that I want to show result that minus the value of @P1, @P2, @P3, this  R.DatetimeSentToReceiver < DATEADD(MONTH, 2, @ReminderMonth) adds 2 months value, what i want is @P4 = @P4 - @P1 now I tried add this in query, and it return with error ofc. How to do this in the correct way? There are many way doing this, I need a great solution for it, what Im after is this, data in current months output, data in last month output.  @ReminderMonth will be every months day 1 so that will change too.
Any help would be great.

            @ReminderMonth date = '2018--01-01';

DECLARE @P1 int =  
        FROM Invoice.Reminder R
        R.DatetimeSentToReceiver >= @ReminderMonth
        AND R.DatetimeSentToReceiver < DATEADD(MONTH, 1, @ReminderMonth)
        AND R.ReminderNumber = 1
        @P2 int =  
        FROM Invoice.Reminder R
        R.DatetimeSentToReceiver >= @ReminderMonth
        AND R.DatetimeSentToReceiver < DATEADD(MONTH, 1, @ReminderMonth)
        AND R.ReminderNumber = 2
        @P3 int =  
        FROM Invoice.Reminder R
        R.DatetimeSentToReceiver >= @ReminderMonth
        AND R.DatetimeSentToReceiver < DATEADD(MONTH, 1, …
Dear expert

Please read the query below, I need first understand this:
R.DatetimeSentToReceiver < DATEADD(MONTH, 1, @ReminderMonth)
What does it do? And then I want to run query every months like Januari then Feb etc. And I dont want it to count everything from the date 2018-01-01 How to do it?


            @ReminderMonth date = '2018-01-01',
            @ReminderNumber1 int = 1,
                  @ReminderNumber2 int = 2;
            Invoice.Reminder R
            R.DatetimeSentToReceiver >= @ReminderMonth
            AND R.DatetimeSentToReceiver < DATEADD(MONTH, 1, @ReminderMonth)
            AND R.ReminderNumber = @ReminderNumber1
                  )As 'Reminder 1',
            Invoice.Reminder R
            R.DatetimeSentToReceiver >= @ReminderMonth
            AND R.DatetimeSentToReceiver < DATEADD(MONTH, 1, @ReminderMonth)
            AND R.ReminderNumber = @ReminderNumber2
                  )As 'Reminder 2'
Become an IT Security Management Expert
Become an IT Security Management Expert

In today’s fast-paced, digitally transformed world of business, the need to protect network data and ensure cloud privacy has never been greater. With a B.S. in Network Operations and Security, you can get the credentials it takes to become an IT security management expert.

The crstal reports were created with Crystal XI R1 on a Windows  7 machine. The user has upgraded to a windows 10 machine 64 bit. When they open a file either on the server or their C drive it will open the report but not let them edit a header field. They can most times edit a text field on the detail line. They cannot suppress a section or they get the error message I attach. I have removed Crystal and reinstall it. I can take the same report and edit it on my windows 10 machine 64 bit. I have Crystal XI R2. Has anyone seen this problem before? I appreciate any help.
This is a continuation and refinement of a previous question.

On a plain power on, my Mac Mini displays the apple symbol and never anything else.

On a power on while holding down the Option and R keys, it displays the apple and a progress bar.  When the progress bar completes, I get the log on dialog and can log on. It behaves completely normally through every process I've tried, even for days.  But if I log off (or restart) (I don't remember at the moment if the effects on logon of logoff and restart are the same) the only way to get it open again is with Option and R at power on.

Does this suggest to anyone what the specific cause might be?
I have a spreadsheet "attached" of "Ring Numbers"
The problem I'm having is the data starting with a "R4" and an "R5" need a "1" inserted in between the R and the 4 and also the R and the 5.
For example
"R4142" needs to be "R14142" & "R5507" needs to be "R15507" in order to be joined with another dataset
I am having issues isolating these specific fields only and entering the "1"
I have the following query on prior help and I added a column 'text1', change the Comp5 heading to Comp15 and I can't get 'text1' and Comp15 values on the result:
        PID INT ,
        TEXT1 VARCHAR(10),
Comp1 VARCHAR(10),
 Comp2 VARCHAR(10),
Comp3 VARCHAR(10),
Comp4 VARCHAR(10),
Comp15 VARCHAR(10)

VALUES ( 11122, '1212', NULL, NULL, NULL, NULL, NULL ) ,
         ( 12345, NULL, NULL, NULL, '123', NULL, NULL ) ,
       ( 23456, NULL, '234', NULL, 'ewr', NULL, NULL ) ,
       ( 34567, NULL, NULL, 'acc', NULL, NULL, 'def' ) ,
       ( 45678, NULL, NULL, NULL, 'jkl', NULL, NULL ) ,
       ( 56789, NULL, NULL, NULL, NULL, NULL, 'we1' ) ,
       ( 23450, NULL, 'abc', 'acc', 'exy', 'ert', 'def' );

WITH Unpivoted
     FROM   @TEMP4 T UNPIVOT(CompValue FOR CompType IN(Comp1, Comp2, Comp3, Comp4, Comp15)) U ) ,
            U.CompValue ,
                                              ORDER BY U.CompType ASC ) AS VARCHAR(255)) AS NewCompType
     FROM   Unpivoted U )
FROM   Reordered R
    PIVOT (   MIN(CompValue)
              FOR NewCompType IN ( Comp1, Comp2, Comp3, Comp4, Comp15 )) P;
I can upload a into RStudio server using shiny.  However, I cannot open the file for editing and saving for processing by the R code.  Apparently, the randsontable library function ransdontable() takes as input a dataframe.  I am using the code below: DF = as.data.frame(read.delim(inFile$datapath))
    rhandsontable(DF, width = 550, height = 300)

but I get the message:

Warning: Error in as.data.frame.default: cannot coerce class "c("rhandsontable", "htmlwidget")" to a data.frame

Is there a solution for this, or is there any other way to open and edit file using shiny?

My code was completely wrong. If anyone wants to find more about the R rhandsontable, please post a question. I will be happy to help.
I have an excel spread sheet that has a column with either b, g or r
I would like to create a formula in a separate column which will convert this to either Blue, Green or red







R is a programming language and environment used primarily for statistical data analysis.

Top Experts In